-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 Amazon Ads: added adId
to product report stream
#11660
Conversation
@agroh1 can you sign the CLA? |
I did sign the CLA for agroh1. I accidentially had the user set incorrectly for the commit and I am trying to figure out how change the user on the commit |
I have rebased the commit so it is now as agroh1 and agroh1 has signed the CLA. agroh is still listed as a contributor but is not on either the repo or any commit |
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 @agroh1 I think we can refactor to become simpler the change, wdyt?
|
||
# adId is automatically added to the report by amazon and requesting adId causes an amazon error | ||
if RecordType.ASINS in record_type: | ||
body["campaignType"] = "sponsoredProducts" | ||
metrics_list = copy(metrics_list) | ||
metrics_list.remove("adId") | ||
if profile.accountInfo.type == "vendor": | ||
metrics_list = copy(metrics_list) | ||
metrics_list.remove("sku") | ||
elif RecordType.PRODUCTADS in record_type: | ||
metrics_list = copy(metrics_list) | ||
metrics_list.remove("adId") | ||
|
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.
# adId is automatically....
if "adId" in metrics_list:
metrics_list.remove("adId")
This way if you add a new report you don't need to change the code again to make it works.
Why is the reason you're using copy?
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 that is probably better. It does assume that all product reports have this problem but I think that is probably correct.
I made a copy because the old code that removed "sku" also made a copy and I assumed that it was probably the right thing.
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.
For those cases we can improve the if logic
if "adId" in metrics_list and not SpecialReport:
metrics_list.remove("adId")
because right now both need to remove it right?
I updated and retested based on your suggestions |
@agroh1 can you update the Dockerfile version? |
Bumped dockerfile |
adId
to product report stream
/test connector=connectors/source-amazon-ads
|
/publish connector=connectors/source-amazon-ads auto-bump-version=false
|
/publish connector=connectors/source-amazon-ads auto-bump-version=false
|
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 @agroh1
* added adId to product report stream * simplified removal of adId * removed duplicate comment * Bumped dockerfile version * bump connector version Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
What
#11659 sponsored_products_report_stream does not return adId despite it being added automatically by amazon
How
Added adId to the request fields so that it will show up in the report sync but don't send it as a requested field to amazon
Recommended reading order
🚨 User Impact 🚨
adId field now returned for appropriate reports in sponsored_products_report_stream
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
Community member? Grant edit access to maintainers (instructions)
Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.Code reviews completed
Documentation updated
README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
PR name follows PR naming conventions
Airbyter
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 hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/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 hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Results (31.92s):
39 passed
Integration
{"type": "RECORD", "record": {"stream": "sponsored_products_report_stream", "data": {"profileId": 3151297663604935, "recordType": "productAds", "reportDate": "20220401", "metric": {"campaignRuleBasedBudget": null, "attributedConversions1dSameSKU": "0", "attributedSales1d": "0", "bidPlus": null, "attributedConversions30dSameSKU": "0", "attributedSales14d": "0", "targetingExpression": null, "attributedSales7d": "0", "campaignBudget": null, "asin": "B07VF2K5DS", "impressions": "0", "campaignStatus": null, "applicableBudgetRuleName": null, "attributedSales14dOtherSKU": null, "attributedSales1dOtherSKU": null, "attributedConversions30d": "0", "attributedSales30dSameSKU": "0", "cost": "0", "attributedConversions14d": "0", "attributedSales7dSameSKU": "0", "applicableBudgetRuleId": null, "attributedUnitsOrdered1dSameSKU": "0", "targetId": null, "attributedUnitsOrdered30d": "0", "currency": "USD", "attributedSales1dSameSKU": "0", "attributedUnitsOrdered14d": "0", "attributedSales14dSameSKU": "0", "attributedConversions7d": "0", "keywordId": null, "attributedUnitsOrdered14dOtherSKU": null, "attributedSales7dOtherSKU": null, "adGroupId": "205722450325390", "attributedUnitsOrdered7dOtherSKU": null, "attributedUnitsOrdered30dSameSKU": "0", "adId": "220368155192190", "keywordText": null, "attributedSales30d": "0", "attributedConversions1d": "0", "campaignId": "128525041765967", "attributedUnitsOrdered14dSameSKU": "0", "attributedUnitsOrdered1d": "0", "attributedConversions14dSameSKU": "0", "attributedUnitsOrdered30dOtherSKU": null, "sku": null, "attributedConversions7dSameSKU": "0", "adGroupName": "Broad", "attributedSales30dOtherSKU": null, "clicks": "0", "attributedUnitsOrdered7dSameSKU": "0", "matchType": null, "targetingText": null, "otherAsin": null, "targetingType": null, "attributedUnitsOrdered7d": "0", "attributedUnitsOrdered1dOtherSKU": null, "campaignName": "Beard Oil | Manual | Unscented"}}, "emitted_at": 1648817346497}} {"type": "asinSameAs", "value": "B07RP1P6HQ"}]}, "emitted_at": 1648818018680}} {"type": "LOG", "log": {"level": "INFO", "message": "Read 423 records from sponsored_product_targetings stream"}} {"type": "LOG", "log": {"level": "INFO", "message": "Finished syncing sponsored_product_targetings"}} {"type": "LOG", "log": {"level": "INFO", "message": "SourceAmazonAds runtimes:\nSyncing stream profiles 0:00:00.001417\nSyncing stream sponsored_display_ad_groups 0:00:00.270174\nSyncing stream sponsored_display_campaigns 0:00:00.247865\nSyncing stream sponsored_display_targetings 0:00:01.517041\nSyncing stream sponsored_product_ad_groups 0:00:00.397415\nSyncing stream sponsored_product_campaigns 0:00:00.363708\nSyncing stream sponsored_product_keywords 0:00:20.981859\nSyncing stream sponsored_product_negative_keywords 0:00:16.667616\nSyncing stream sponsored_product_targetings 0:00:00.978489\nSyncing stream sponsored_products_report_stream 0:05:08.647590"}} {"type": "LOG", "log": {"level": "INFO", "message": "Finished syncing SourceAmazonAds"}}
Acceptance
Put your acceptance tests output here.