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 Google-Ads: add "login-customer-id" setting #5159

Conversation

yevhenii-ldv
Copy link
Contributor

What

closes #5150.

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

Pre-merge Checklist

Expand the checklist which is relevant for this PR.

Connector checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • Secrets are annotated with airbyte_secret in the connector's spec
  • Credentials added to Github CI if needed and not already present. instructions for injecting secrets into CI.
  • Unit & integration tests added as appropriate (and are passing)
    • Community members: please provide proof of this succeeding locally e.g: screenshot or copy-paste 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.
  • /test connector=connectors/<name> command as documented here is passing.
    • Community members can skip this, Airbyters will run this for you.
  • Code reviews completed
  • Documentation updated
    • README.md
    • docs/SUMMARY.md if it's a new connector
    • Created or updated reference docs in docs/integrations/<source or destination>/<name>.
    • Changelog in the appropriate page in docs/integrations/.... See changelog example
    • docs/integrations/README.md contains a reference to the new connector
    • Build status added to build page
  • Build is successful
  • Connector version bumped like described here
  • New Connector version released on Dockerhub by running the /publish command described here
  • No major blockers
  • PR merged into master branch
  • Follow up tickets have been created
  • Associated tickets have been closed & stakeholders notified

Connector Generator checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Aug 3, 2021
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Aug 3, 2021

/test connector=connectors/source-google-ads

🕑 connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/1094345233
✅ connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/1094345233

@jrhizor jrhizor temporarily deployed to more-secrets August 3, 2021 14:47 Inactive
@@ -46,6 +46,8 @@ class GoogleAds:
DEFAULT_PAGE_SIZE = 1000

def __init__(self, credentials: Mapping[str, Any], customer_id: str):
if "login_customer_id" in credentials and not credentials["login_customer_id"].strip():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if login_customer_id filed is empty then remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

return True, None
except Exception as error:
return False, f"Unable to connect to Google Ads API with the provided credentials - {repr(error)}"
except GoogleAdsException as error:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove try/except block, any exception would be catch on AbstractSource check method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the main goal of the try/except is the correct formulation of the error message.

@@ -51,6 +51,7 @@ Google Ads Account with an approved Developer Token \(note: In order to get API
* refresh_token
* start_date
* customer_id
* login_customer_id (more information about this field you can find in [Google Ads docs](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* login_customer_id (more information about this field you can find in [Google Ads docs](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid))
* login_customer_id (you can find more information about this field in [Google Ads docs](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid))

@@ -46,6 +46,8 @@ class GoogleAds:
DEFAULT_PAGE_SIZE = 1000

def __init__(self, credentials: Mapping[str, Any], customer_id: str):
if "login_customer_id" in credentials and not credentials["login_customer_id"].strip():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if "login_customer_id" in credentials and not credentials["login_customer_id"].strip():
# https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
if "login_customer_id" in credentials and not credentials["login_customer_id"].strip():

@@ -39,13 +39,18 @@
"title": "Refresh Token",
"description": "Refresh token generated using developer_token, oauth_client_id, and oauth_client_secret. More instruction on how to find this value in our <a href=\"https://docs.airbyte.io/integrations/sources/google-adwords#setup-guide\">docs</a>",
"airbyte_secret": true
},
"login_customer_id": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a separate field outside of credentials since that is an autogenerated json which will likely not contain this information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@Zirochkaa Zirochkaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Aug 3, 2021

/test connector=connectors/source-google-ads

🕑 connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/1094490944
✅ connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/1094490944

@jrhizor jrhizor temporarily deployed to more-secrets August 3, 2021 15:30 Inactive
@yevhenii-ldv
Copy link
Contributor Author

yevhenii-ldv commented Aug 3, 2021

/publish connector=connectors/source-google-ads

🕑 connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/1094633564
✅ connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/1094633564

@jrhizor jrhizor temporarily deployed to more-secrets August 3, 2021 16:13 Inactive
@yevhenii-ldv yevhenii-ldv merged commit 87c7646 into master Aug 3, 2021
@yevhenii-ldv yevhenii-ldv deleted the ykurochkin/google-ads-source-connector-need-a-login-customer-id-setting branch August 3, 2021 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Ads source connector: Need a "login-customer-id" setting
6 participants