Skip to content

Conversation

@edgao
Copy link
Contributor

@edgao edgao commented Mar 17, 2022

What

Closes #10662

These streams tie together the label IDs with their actual names; users can sync these streams and then join them downstream. GAQL makes it a real pain to do that join (we'd have to do it ourselves in Python because they don't attribute the *_label resources to their corresponding tables).

For example, the ad_groups stream might output records like {"ad_group.labels":["customers/4651612872/labels/21585034471"], ....}. ad_group_labels has records that look like this:

{ "ad_group.resource_name": "customers/4651612872/adGroups/123273719655", "ad_group_label.resource_name": "customers/4651612872/adGroupLabels/123273719655~21585034471", "label.name": "edgao-example-label", "label.resource_name": "customers/4651612872/labels/21585034471" }

Users would be expected to join these two streams together in order to use attach label.name field to the ad_group records.

Recommended reading order

  1. *.json
  2. streams.py
  3. source.py+ google_ads.py
  4. test_source.py

🚨 User Impact 🚨

nope

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • 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
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • 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.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
@github-actions github-actions bot added the area/connectors Connector related issues label Mar 17, 2022
@edgao edgao force-pushed the edgao/source_gads_campaign_label branch from 8e3d050 to 92db4e5 Compare March 18, 2022 21:11
@edgao
Copy link
Contributor Author

edgao commented Mar 18, 2022

/test connector=connectors/source-google-ads

@edgao
Copy link
Contributor Author

edgao commented Mar 21, 2022

/test connector=connectors/source-google-ads

🕑 connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/2013896002
✅ connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/2013896002
Python tests coverage:

Name Stmts Miss Cover ------------------------------------------------------------------------ source_acceptance_test/utils/__init__.py 6 0 100% source_acceptance_test/tests/__init__.py 4 0 100% source_acceptance_test/__init__.py 2 0 100% source_acceptance_test/tests/test_full_refresh.py 52 2 96% source_acceptance_test/utils/asserts.py 37 2 95% source_acceptance_test/config.py 74 6 92% source_acceptance_test/utils/json_schema_helper.py 105 13 88% source_acceptance_test/utils/common.py 70 17 76% source_acceptance_test/utils/compare.py 62 23 63% source_acceptance_test/tests/test_core.py 275 106 61% source_acceptance_test/base.py 10 4 60% source_acceptance_test/utils/connector_runner.py 110 48 56% source_acceptance_test/tests/test_incremental.py 69 38 45% ------------------------------------------------------------------------ TOTAL 876 259 70% Name Stmts Miss Cover -------------------------------------------------------------- source_google_ads/__init__.py 2 0 100% source_google_ads/google_ads.py 68 10 85% source_google_ads/streams.py 142 24 83% source_google_ads/source.py 73 24 67% source_google_ads/custom_query_stream.py 75 50 33% -------------------------------------------------------------- TOTAL 360 108 70% Name Stmts Miss Cover -------------------------------------------------------------- source_google_ads/__init__.py 2 0 100% source_google_ads/streams.py 142 11 92% source_google_ads/custom_query_stream.py 75 6 92% source_google_ads/google_ads.py 68 7 90% source_google_ads/source.py 73 19 74% -------------------------------------------------------------- TOTAL 360 43 88% 

Python short test summary info:

=========================== short test summary info ============================ SKIPPED [1] ../usr/local/lib/python3.7/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config ================== 21 passed, 1 skipped in 1331.02s (0:22:11) ================== 
@edgao
Copy link
Contributor Author

edgao commented Mar 22, 2022

/test connector=connectors/source-google-ads

@edgao
Copy link
Contributor Author

edgao commented Mar 22, 2022

/test connector=connectors/source-google-ads

🕑 connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/2024863586
✅ connectors/source-google-ads https://github.com/airbytehq/airbyte/actions/runs/2024863586
Python tests coverage:

Name Stmts Miss Cover ------------------------------------------------------------------------ source_acceptance_test/utils/__init__.py 6 0 100% source_acceptance_test/tests/__init__.py 4 0 100% source_acceptance_test/__init__.py 2 0 100% source_acceptance_test/tests/test_full_refresh.py 52 2 96% source_acceptance_test/utils/asserts.py 37 2 95% source_acceptance_test/config.py 74 6 92% source_acceptance_test/utils/json_schema_helper.py 105 13 88% source_acceptance_test/utils/common.py 70 17 76% source_acceptance_test/utils/compare.py 62 23 63% source_acceptance_test/tests/test_core.py 275 106 61% source_acceptance_test/base.py 10 4 60% source_acceptance_test/utils/connector_runner.py 110 48 56% source_acceptance_test/tests/test_incremental.py 69 38 45% ------------------------------------------------------------------------ TOTAL 876 259 70% Name Stmts Miss Cover -------------------------------------------------------------- source_google_ads/__init__.py 2 0 100% source_google_ads/google_ads.py 68 10 85% source_google_ads/streams.py 142 24 83% source_google_ads/source.py 73 24 67% source_google_ads/custom_query_stream.py 75 50 33% -------------------------------------------------------------- TOTAL 360 108 70% Name Stmts Miss Cover -------------------------------------------------------------- source_google_ads/__init__.py 2 0 100% source_google_ads/streams.py 142 11 92% source_google_ads/custom_query_stream.py 75 6 92% source_google_ads/google_ads.py 68 7 90% source_google_ads/source.py 73 19 74% -------------------------------------------------------------- TOTAL 360 43 88% 

Python short test summary info:

=========================== short test summary info ============================ SKIPPED [1] ../usr/local/lib/python3.7/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config ================== 21 passed, 1 skipped in 1633.21s (0:27:13) ================== 
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Mar 22, 2022
* [keyword](https://developers.google.com/google-ads/api/fields/v8/keyword_view)
* [geographic](https://developers.google.com/google-ads/api/fields/v8/geographic_view)

Note that `ad_groups`, `ad_group_ads`, and `campaigns` contain a `labels` field, which should be joined against their respective `*_labels` streams if you want to view the actual labels.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@misteryeo does this sentence sound good to you? (this is to address #10662 )

Copy link
Contributor

Choose a reason for hiding this comment

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

could you indicate the join field?

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, done

@edgao edgao marked this pull request as ready for review March 22, 2022 22:17
@edgao edgao requested a review from sherifnada March 22, 2022 22:18
* [keyword](https://developers.google.com/google-ads/api/fields/v8/keyword_view)
* [geographic](https://developers.google.com/google-ads/api/fields/v8/geographic_view)

Note that `ad_groups`, `ad_group_ads`, and `campaigns` contain a `labels` field, which should be joined against their respective `*_labels` streams if you want to view the actual labels.
Copy link
Contributor

Choose a reason for hiding this comment

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

could you indicate the join field?

@edgao
Copy link
Contributor Author

edgao commented Mar 23, 2022

/publish connector=connectors/source-google-ads

@edgao
Copy link
Contributor Author

edgao commented Mar 23, 2022

/publish connector=connectors/source-google-ads

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

@edgao edgao temporarily deployed to more-secrets March 23, 2022 20:36 Inactive
@edgao edgao temporarily deployed to more-secrets March 23, 2022 20:37 Inactive
@edgao edgao merged commit d61af1b into master Mar 23, 2022
@edgao edgao deleted the edgao/source_gads_campaign_label branch March 23, 2022 20:37
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

3 participants