-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🐛 Source Google Ads: refactor date slicing #27711
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 Google Ads: refactor date slicing #27711
Conversation
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,
|
|
Step | Result |
---|---|
Validate airbyte-integrations/connectors/source-google-ads/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
Code format checks | ✅ |
Connector package install | ✅ |
Build source-google-ads docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ✅ |
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-google-ads test
|
Step | Result |
---|---|
Validate airbyte-integrations/connectors/source-google-ads/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
Code format checks | ✅ |
Connector package install | ✅ |
Build source-google-ads docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ✅ |
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-google-ads test
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.
a few small suggestions and wanted to clarify something about how we calculate yesterday. onboarding with the clean up of the code!
airbyte-integrations/connectors/source-google-ads/source_google_ads/streams.py
Show resolved
Hide resolved
airbyte-integrations/connectors/source-google-ads/source_google_ads/streams.py
Outdated
Show resolved
Hide resolved
while slice_start.date() <= end_date.date(): | ||
slice_end = min(end_date, slice_start.add(days=range_days - 1)) | ||
yield { | ||
"start_date": slice_start.to_date_string(), |
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.
So just to confirm the API behavior, Google's API fetches all records inclusive of the start date passed in and inclusive of the end date passed in? And in the prior code, we took the start date and added 1 day. Thus how we ended up with the >
operation on the start date?
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.
Yes, both start date and end date are inclusive. We did not actually end up with >
, the problem was with the start date of the initial slice. If the user used to enter 2020-01-01
as a start date, we would generate slices starting from 2020-01-02
, that's the whole point. Now having refactored the code, slicing starts with 2020-01-01
as expected
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.
perfect, thanks for confirming!
|
Step | Result |
---|---|
Validate airbyte-integrations/connectors/source-google-ads/metadata.yaml | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
Code format checks | ✅ |
Connector package install | ✅ |
Build source-google-ads docker image for platform linux/x86_64 | ✅ |
Unit tests | ✅ |
Acceptance tests | ✅ |
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-google-ads test
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.
changes lgtm!
while slice_start.date() <= end_date.date(): | ||
slice_end = min(end_date, slice_start.add(days=range_days - 1)) | ||
yield { | ||
"start_date": slice_start.to_date_string(), |
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.
perfect, thanks for confirming!
What
https://github.com/airbytehq/oncall/issues/2344
How
🚨 User Impact 🚨