-
Notifications
You must be signed in to change notification settings - Fork 31
fix: propagate api_budget to parent streams in substream partition routers #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: propagate api_budget to parent streams in substream partition routers #826
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 <>
Original prompt from API User |
🤖 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. |
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