Repository navigation
fix: pass API budget to custom requesters - #1034
Daryna Ishchenko (darynaishchenko) merged 2 commits into
Conversation
🤖 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. 💡 Show Tips and TricksTesting 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/1779720474-custom-requester-api-budget#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/1779720474-custom-requester-api-budgetPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
📝 WalkthroughWalkthroughFactory now conditionally injects its root ChangesAPI Budget Injection to Custom Components
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Would you like me to suggest a short unit-test assertion that checks the exact number of policies more explicitly (wdyt?) 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
api_budgetinto custom components that accept anapi_budgetfield, coveringCustomRequestersubclasses ofHttpRequesterinstantiated through the generic custom component path.api_budget, that value still wins; this change does not sync or override_http_clientafter construction.HttpAPIBudgetwhen it does not override it, and a custom requester that sets its own default budget is not overwritten.ReportCreationRequesterextendsHttpRequesterbut was not receiving the manifest API budget from the CDK.Review & Testing Checklist for Human
api_budget.self.api_budgetin__post_init__()should continue owning their own budget behavior.POST /reports/2021-06-30/reportsand the preflightGET /reports/2021-06-30/reportsare rate-limited by the manifestapi_budget.Notes
Requested by Daryna Ishchenko.
Useful context from the related closed PR: some connectors already use custom requester API-budget overrides as a workaround or for connector-specific behavior. This PR only passes the CDK budget into the constructor path; it intentionally does not apply CDK-side
_http_clientsync logic.Local checks run:
poetry run ruff check airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py unit_tests/sources/declarative/parsers/test_model_to_component_factory.py unit_tests/sources/declarative/parsers/testing_components.pypoetry run pytest unit_tests/sources/declarative/parsers/test_model_to_component_factory.py::test_api_budget_passed_to_custom_requester unit_tests/sources/declarative/parsers/test_model_to_component_factory.py::test_api_budget_does_not_override_custom_requester_default_value -qLink to Devin session: https://app.devin.ai/sessions/2f69c7eea1164909b1e03b09862574a1
Requested by: Daryna Ishchenko (@darynaishchenko)
Summary by CodeRabbit
Bug Fixes
Tests