-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Bing Ads: Add Report streams #5750
Conversation
…udar/5075-bing-ads-reports
…udar/5075-bing-ads-reports
/test connector=connectors/source-bing-ads
|
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.
LGTM
Leave few minor comments.
airbyte-integrations/connectors/source-bing-ads/source_bing_ads/reports.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py
Outdated
Show resolved
Hide resolved
…udar/5075-bing-ads-reports
airbyte-integrations/connectors/source-bing-ads/source_bing_ads/client.py
Outdated
Show resolved
Hide resolved
"default": "2020-01-01", | ||
"description": "From which date perform initial sync for report related streams. In YYYY-MM-DD format" | ||
}, | ||
"report_aggregation": { |
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.
need clarification:
So now user should choose one of the aggregation types,
Did we consider choosing a few types at the same time - hourly and monthly for example.
Do you have any ideas on how it works in other EL tools?
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.
Did we consider choosing a few types at the same time - hourly and monthly for example.
no, I don't consider this. What's the purpose of that ?
Do you have any ideas on how it works in other EL tools?
one tool has hardcoded Daily value, another tool has 2 separate streams for Daily and Hourly aggregation. I think my solution is more flexible
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.
Please raise this question on Airbyte review: "Did we consider choosing a few types at the same time - hourly and monthly for 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.
In my understanding, we should support sync of hourly, daily or another 'agreggations' streams simultaneously.
We may also discuss this question with Maxim before Airbyte review.
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 think we can offer flexibility here pretty easily on top of the current code and therefore imo we should.
Options in spec could be boolean toggles for each of hourly
, daily
, weekly
, monthly
, where all off could mean no report streams (and possibly help for backwards compat.?)
In SourceBingAds
class, we'd then need to run some logic checking which of those toggles are on/off and setting up relevant report streams for each. e.g.
hourly
and monthly
are toggled on, so we add streams:
- AccountPerformanceReportHourly
- AccountPerformanceReportMonthly
- AdGroupPerformanceReportHourly
- AdGroupPerformanceReportMonthly
- and so on and so on for all reports...
This would give the user ultimate flexibility and shouldn't require any major changes to the code, wdyt?
Hey @yaroslav-dudar, would you mind adding a |
|
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.
Really like the approach using a Mixin, clean!
Main change request on allowing for multiple report frequencies, seems like low-hanging fruit worth taking to be on par / better than other like-for-like tools.
Other point worth mentioning is on the state-per-account-id comment. I know this stream already implements this so I won't let it block merge but after discussing with Eugene I think we need a solution to avoid the state becoming too large (we can discuss on the comment itself in the code)
airbyte-integrations/connectors/source-bing-ads/source_bing_ads/reports.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-bing-ads/source_bing_ads/reports.py
Outdated
Show resolved
Hide resolved
for account in source_bing_ads.source.Accounts(self.client, self.config).read_records(SyncMode.full_refresh): | ||
yield {"account_id": account["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'm assuming this isn't in any sort of time-order using account_id as the slicing of stream slices but you're saving state for each account ID.
I've discussed this with @keu recently and my main concern with this approach is that we have a potentially boundless state size. Is there a hard limit on the amount of account IDs there can be or could it potentially be millions?
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 think there should be strict limit of amount of accounts per user
"default": "2020-01-01", | ||
"description": "From which date perform initial sync for report related streams. In YYYY-MM-DD format" | ||
}, | ||
"report_aggregation": { |
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 think we can offer flexibility here pretty easily on top of the current code and therefore imo we should.
Options in spec could be boolean toggles for each of hourly
, daily
, weekly
, monthly
, where all off could mean no report streams (and possibly help for backwards compat.?)
In SourceBingAds
class, we'd then need to run some logic checking which of those toggles are on/off and setting up relevant report streams for each. e.g.
hourly
and monthly
are toggled on, so we add streams:
- AccountPerformanceReportHourly
- AccountPerformanceReportMonthly
- AdGroupPerformanceReportHourly
- AdGroupPerformanceReportMonthly
- and so on and so on for all reports...
This would give the user ultimate flexibility and shouldn't require any major changes to the code, wdyt?
Also, thanks @yaroslav-dudar for the bootstrap and reading order 👍 !! |
/test connector=connectors/source-bing-ads
|
/test connector=connectors/source-bing-ads
|
/test connector=connectors/source-bing-ads
|
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.
Awesome, thanks for adding those toggles, offering max flexibility for the user now 👍
It's not ideal bumping down setuptools but I think it should be temporary since there is an open issue and PR to fix that problem in BingAds lib (see my comment)
@@ -7,3 +9,14 @@ plugins { | |||
airbytePython { | |||
moduleDirectory 'source_bing_ads' | |||
} | |||
|
|||
// setuptools 58.* removed support for use_2to3 which leads to the following issue: | |||
// error in suds-jurko setup command: use_2to3 is invalid. |
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.
looks like there is an open issue for this on BingAds-Python-SDK repo.
Might be worth adding a link to that with a note to update the bingads lib version and remove this step in gradle once it is resolved
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.
hey, Phlair. Will this problem be solved by upgrade bing ads version?
"hourly_reports": true, | ||
"daily_reports": false, | ||
"weekly_reports": false, | ||
"monthly_reports": true |
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.
best coverage here would be testing all of these, any reason not to? (it doesn't need to block this PR, a separate issue maybe?)
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.
it's an invalid config, actual config stored in github secrets. I think we can update secret even without an issue
/test connector=connectors/source-bing-ads
|
/publish connector=connectors/source-bing-ads
|
Hi all! Why are we only supporting a subset of the columns provided by the bing ads api? https://discuss.airbyte.io/t/bing-ads-missing-a-lot-of-fields-is-this-intentional/1824 |
What
added report streams to the connector #5075
How
Describe the solution
Recommended reading order
reports.py
source.py
client.py
Pre-merge Checklist
Expand the relevant checklist and delete the others.
Updating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
docs/integrations/<source or destination>/<name>.md
including 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./publish
command described here