Skip to content
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

source-hubspot-native: ignore search results with timestamps more recent than the requested window #2210

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions source-hubspot-native/source_hubspot_native/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,15 @@ async def fetch_search_objects(

for r in result.results:
this_mod_time = r.properties.hs_lastmodifieddate

if until and this_mod_time > until:
log.info(
"ignoring search result with record modification time that is later than maximum search window",
{id: r.id, "this_mod_time": this_mod_time, "until": until},
)
continue

if this_mod_time < max_updated:
# This should never happen since results are requested in
# ASCENDING order by the last modified time.
raise Exception(f"last modified date {this_mod_time} is before {max_updated} for {r.id}")

max_updated = this_mod_time
Expand Down
Loading