-
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
✨ Source Mailchimp: Add optional start_date to config #32852
Conversation
…stamp_without_timezone (#32595)
…fic_type` field to AdGroups stream (#32747)
… ad accounts during `check` (#32731)
… expected records, migrate base image (#32718) Co-authored-by: pnilan <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
…bytehq/airbyte into christo/mailchimp-start-date
if start_date_parsed and state_date_parsed: | ||
return max(start_date_parsed, state_date_parsed) | ||
elif state_date_parsed or start_date_parsed: | ||
return state_date_parsed or start_date_parsed | ||
else: | ||
return 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.
if start_date_parsed and state_date_parsed: | |
return max(start_date_parsed, state_date_parsed) | |
elif state_date_parsed or start_date_parsed: | |
return state_date_parsed or start_date_parsed | |
else: | |
return None | |
# Return the maximum of the two dates if both are present, otherwise return whichever is present, or None | |
if start_date_parsed or state_date_parsed: | |
return max(filter(None, [start_date_parsed, state_date_parsed]), default=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.
Updated
@@ -157,7 +181,11 @@ def stream_slices(self, stream_state: Mapping[str, Any] = None, **kwargs) -> Ite | |||
stream_state = stream_state or {} | |||
parent = Lists(authenticator=self.authenticator).read_records(sync_mode=SyncMode.full_refresh) | |||
for slice in parent: | |||
yield {"list_id": slice["id"]} | |||
slice_ = {"list_id": slice["id"]} |
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.
I believe we can rename slice
to parent_record
and slice_
to slice
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.
Good call, updated
if filter_date is None or record_cursor_value >= filter_date: | ||
yield record |
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.
this is can be separate filtration function
check Hubspot connector as example
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.
Thanks for the pointer 👍 A separate method, filter_old_records, is now declared in the base MailchimpIncrementalStream class and invoked by streams which do not support the server-side filter.
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.
Nice!
What
Adds an optional
start_date
to Source Mailchimp's config, to resolve customer request in #20814How
start_date
is provided by a user via config, incremental streams will compare it against the value found in the current stream slice's state, to determine which to use as a filter in the query params. If only one of these values exists, it will be used by default.User Impact
No impact on current customers. The start_date in config is an optional input and defaults to None if left empty. Therefore, for users with existing connections, the currently existing logic resumes, whereby the connector always fetches and reads all available data during first sync.