fix: propagate api_budget to parent streams in substream partition routers#826
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
fix: propagate api_budget to parent streams in substream partition routers#826devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
…uters When parent streams are created for substream partition routers, a new ModelToComponentFactory instance is created without the global _api_budget being propagated. This causes parent streams to ignore rate limiting configuration, leading to 403 errors when API rate limits are exceeded. This fix ensures that the _api_budget is propagated to the new factory instance so parent streams respect the same rate limiting configuration as child streams. Fixes airbytehq/oncall#9874 Co-Authored-By: unknown <>
Contributor
Author
Original prompt from API User |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1762216217-fix-api-budget-parent-streams#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1762216217-fix-api-budget-parent-streamsHelpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: unknown <>
PyTest Results (Full)3 820 tests 3 808 ✅ 11m 13s ⏱️ Results for commit 48be581. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: propagate api_budget to parent streams in substream partition routers
Summary
This PR fixes issue airbytehq/oncall#9874 where
api_budgetconfiguration was not being applied to parent streams in parent-child stream scenarios, causing 403 rate limit errors.Root Cause: When
create_parent_stream_config_with_substream_wrappercreates a newModelToComponentFactoryinstance for handling parent streams inSubstreamPartitionRouterscenarios, the global_api_budgetwas not being propagated to the new factory instance.Fix: Added one line to propagate
_api_budgetfrom the parent factory to the substream factory, ensuring parent streams respect the same rate limiting configuration as child streams.Changed Files:
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py(2 lines added)Review & Testing Checklist for Human
This is a targeted fix with minimal code changes, but has medium confidence due to limited test coverage:
api_budgetconfiguration and no longer hit 403 rate limit errorspytest unit_tests/sources/declarative/parsers/test_model_to_component_factory.py)_api_budgetvia direct field assignment is the correct approach (consistent with how other factory state is handled)Test Plan Recommendation
To verify the fix end-to-end:
api_budgetconfiguration with a low rate limit (e.g., 29 requests/minute)SubstreamPartitionRouterthat depends on a parent streamNotes
test_create_substream_partition_routerandtest_api_budget), but explicit test coverage for api_budget propagation to parent streams would be beneficial.Session: https://app.devin.ai/sessions/14c6cca74bb741e782dfb81d6e2a2c50
Requested by: unknown () via
/ai-fixcommand on oncall issue #9874