Skip to content

Commit

Permalink
fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
agatav committed Nov 22, 2024
1 parent 056cdb8 commit def23be
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,7 @@ def _process_search(
}
if self.state
else {
"filters": [{"value": int(self._start_date.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "GTE"}],
"sorts": [{"propertyName": self.last_modified_field, "direction": "ASCENDING"}],
"sorts": [{"propertyName": key, "direction": "ASCENDING"}],
"properties": properties_list,
"limit": 200,
}
Expand Down Expand Up @@ -1230,7 +1229,7 @@ def read_records(
next_page_token = self.next_page_token(raw_response)
if not next_page_token:
pagination_complete = True
elif self.state and next_page_token["payload"]["after"] >= 10000:
elif next_page_token["payload"]["after"] >= 10000:
# Hubspot documentation states that the search endpoints are limited to 10,000 total results
# for any given query. Attempting to page beyond 10,000 will result in a 400 error.
# https://developers.hubspot.com/docs/api/crm/search. We stop getting data at 10,000 and
Expand Down

0 comments on commit def23be

Please sign in to comment.