-
Notifications
You must be signed in to change notification settings - Fork 30
fix: url and path joining for cursor paginators #695
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
Conversation
👋 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@lmossman/fix-pagination-again#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 lmossman/fix-pagination-again Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a pagination bug that was introduced in a previous change where consecutive pages would incorrectly remove the URL base from the next page token, causing pagination to break in certain connectors.
- Removes the URL base replacement logic from the paginator path method
- Simplifies the path method to return the token directly without modification
airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py
Show resolved
Hide resolved
PyTest Results (Fast)3 694 tests - 1 3 683 ✅ - 1 6m 27s ⏱️ -8s Results for commit 1117b0e. ± Comparison against base commit f976c72. This pull request removes 1 test.
♻️ This comment has been updated with latest results. |
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested labels
Suggested reviewers
Would you like to add a test case to ensure this simplified logic covers all expected token formats, wdyt? Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PyTest Results (Full)3 697 tests - 1 3 686 ✅ - 1 11m 39s ⏱️ +6s Results for commit 1117b0e. ± Comparison against base commit f976c72. This pull request removes 1 test.
♻️ This comment has been updated with latest results. |
37f2251
to
83365d4
Compare
What
Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/13873
This should also fix these two issues reported by users: https://github.com/airbytehq/oncall/issues/8283 https://airbyte1416.zendesk.com/agent/tickets/13510
Basically, the current logic for handling cursor pagination tokens does not work in every case. Namely:
How
This PR aims to solve both issues by cleaning up the cursor pagination path joining logic.
The two main changes here are:
_join_url
to combine theurl
andpath
instead of naively concatenating them togetherurl_base
from the next page token when returning thepath
in the default_paginator. This should be a safe change because_join_url
callsurljoin
fromurllib
, which properly handles all of the cases we care about:/path/to/endpoint
, it will properly append that to the end of the base URLurljoin
will just return that full url and ignore the base URL, which is what we want for cursor paginationSummary by CodeRabbit
Bug Fixes
Tests