Repository navigation
π Source Salesforce: fix bug with pagination for BULK API - #6209
Yevhenii (yevhenii-ldv) merged 4 commits into
Conversation
|
/test connector=connectors/source-salesforce
|
| def next_page_token(self, last_record: dict) -> str: | ||
| if self.primary_key and self.name not in UNSUPPORTED_FILTERING_STREAMS: | ||
| return f"WHERE {self.primary_key} > '{last_record[self.primary_key]}' " | ||
| return f"WHERE {self.primary_key} >= '{last_record[self.primary_key]}' " |
There was a problem hiding this comment.
are PKs numeric and incremental? why are we not using cursor field here?
There was a problem hiding this comment.
This is used for Full Refresh streams. It turned out that it is impossible to use Offset more than 2000 - Salesforce API swears at this, so I had to use the same method as for Incremental, only use ID, not cursor_field.
| if job_status in ["JobComplete", "Aborted", "Failed"]: | ||
| self.delete_job(url=job_full_url) | ||
| pagination_complete = True | ||
| if job_status in ["Aborted", "Failed"]: |
There was a problem hiding this comment.
should we be raising exception if the job failed?
There was a problem hiding this comment.
Done
| if len(response_data["records"]) == self.limit and self.primary_key and self.name not in UNSUPPORTED_FILTERING_STREAMS: | ||
| return f"WHERE {self.primary_key} > '{response_data['records'][-1][self.primary_key]}' " | ||
| if len(response_data["records"]) == self.page_size and self.primary_key and self.name not in UNSUPPORTED_FILTERING_STREAMS: | ||
| return f"WHERE {self.primary_key} >= '{response_data['records'][-1][self.primary_key]}' " |
There was a problem hiding this comment.
why aer we comparing PK and not cursor field?
There was a problem hiding this comment.
Answered in the comment above
|
/test connector=connectors/source-salesforce
|
β¦urochkin/salesforce-bug-with-bulk-pagination
|
/publish connector=connectors/source-salesforce
|
What
closes #6122.
How
Describe the solution
Recommended reading order
x.javay.pythonPre-merge Checklist
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>command is passing./publishcommand described here