-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
low-code: Add last_page_size and last_record to pagination context #36408
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
decoded_response = self.decoder.decode(response) | ||
|
||
# The default way that link is presented in requests.Response is a string of various links (last, next, etc). This | ||
# is not indexable or useful for parsing the cursor, so we replace it with the link dictionary from response.links | ||
headers = response.headers | ||
headers: Dict[str, Any] = dict(response.headers) |
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.
for mypy
self.config, | ||
response=decoded_response, | ||
headers=headers, | ||
last_records=last_records, |
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.
last_records will be removed in a follow up PR
token = self.cursor_value.eval(config=self.config, last_records=last_records, response=decoded_response, headers=headers) | ||
token = self._cursor_value.eval( | ||
config=self.config, | ||
last_records=last_records, |
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.
last_records will be removed in a follow up PR
…m:airbytehq/airbyte into alex/replace_last_records_from_paginators
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.
makes sense to me!
headers["link"] = response.links | ||
|
||
if self.stop_condition: | ||
should_stop = self.stop_condition.eval(self.config, response=decoded_response, headers=headers, last_records=last_records) | ||
last_record = last_records[-1] if last_records else None |
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.
and this would presumably be removed later in favor of an incoming last_record
param as per the description?
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.
that's right. It'll be passed as a param
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
What
Add
last_page_size
andlast_record
interpolation variables to the cursor pagination strategy as a first step towards closing https://github.com/airbytehq/airbyte-internal-issues/issues/6554.These two variables are meant to replace
last_records
, which is now removed from the documented interpolation context. The field should now be considered to be deprecated. It will be deleted in a follow up PR.last_records
: update low-code connectors using last_records #36409