You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/22 12:04:15 UTC

[GitHub] [airflow] infused-kim opened a new pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

infused-kim opened a new pull request #17160:
URL: https://github.com/apache/airflow/pull/17160


   closes: #17111
   
   # Description
   This PR adjusts the google ads hook to support newer versions of the google-ads library. 
   
   Before this PR google-ads library v7.0.0 was installed, while the latest version is 13.0.0. I presume the reason for this is because google introduced a backwards incompatible change in version 10.0.0.
   
   This PR  should make the hook work with google-ads >= 10.0.0, but I have only tested it on the latest 13.0.0 version.
   
   The biggest breaking change in the google-ads API was that instead of returning results as native protocol buffers, it's now returning the data in a simpler to use proto-plus format. 
   
   To ensure backwards compatibility for older operators that use the hook, I made the `search()` method convert the data back into native protocol buffers. In addition to that I added a `search_proto_plus()` method that returns the data in the new proto-plus format.
   
   # Testing
   This is my first time submitting a pull request for airflow. 
   
   Unfortunately I don't have a test environment set up. I apologize for that, but since google completely stopped supporting the v5 API and everyone's google ads integrations are broken due to this issue, I decided it may be worth submitting my fix even though I wasn't able to run unit tests on it.
   
    I did test the changes on my local installation with my operators and dags though.
   
   Please let me know if you'd like me to adjust anything.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #17160:
URL: https://github.com/apache/airflow/pull/17160


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-885029798


   > You can also just go ahead and make edits yourself if you prefer.
   
   Yeah. it's just enough to have it there - release manager (that would be me :) ) reviews it and rewords if needed when the time of release comes (that would likely be tomorrow but I keep on repeating it every day now so it might be a bit later)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884918102


   > Sounds good to me! To handle the python 3.6 support issue, perhaps it would be better to adjust the supported versions to <= 12.0.0, because 12.0.0 has support for the latest API while still being compatible with python 3.6.
   
   No, No. this is perfectly fine we have a sophisticated constraint mechanism working for released versions of Airflow and providers which has a separate set of constraints per python version.
   
   However - I see some tests are failing so it would be great to fix them!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884862646


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-886256624


   Awesome work, congrats on your first merged pull request!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884891645


   Can you add note in changelog? It looks like a breaking change. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] infused-kim commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
infused-kim commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884877246


   Actually since I made the default version of the API v8, it should be >=12.0.0 probably. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884919985


   > Can you add note in changelog? It looks like a breaking /dangerous change, so we should warn users about it.
   
   Yep. In case it is breaking change, adding a note to google's CHANGELOG.rst would be good (I will add version, list of changes) but if there is anything required by the user to migrate, that needs to be mentioned (as a short description)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj edited a comment on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884891645


   Can you add note in changelog? It looks like a breaking /dangerous change, so we should warn users about it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] infused-kim commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
infused-kim commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884867231


   > Nice! Thanks a lot @infused-kim - that's really helpful. I am tempted to merge that change before we release the next wave of providers, without too much of system testing as indeed it is anyhow broken now for ads users. We can ask several people to test when we release RC - there were at lest a few users who wanted it, so I think I will be able to engage them with testing it!
   
   Sounds good to me! To handle the python 3.6 support issue, perhaps it would be better to adjust the supported versions to <= 12.0.0, because 12.0.0 has support for the latest API while still being compatible with python 3.6.
   
   I only realized that after submitting the PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#discussion_r675205605



##########
File path: airflow/providers/google/CHANGELOG.rst
##########
@@ -21,6 +21,22 @@ Changelog
 4.1.0
 .....
 
+Breaking changes
+~~~~~~~~~~~~~~~~
+
+* ``Updated GoogleAdsHook to support newer API versions after google deprecated v5. Google Ads v8 is the new default API. (#17111)``
+
+.. warning:: The underlying google-ads library had breaking changes.
+   
+   Previously the google ads library returned data as native protobuf messages. Now it returns data as proto-plus objects that behave more like conventional Python objects. 
+
+   To preserve compatibility the hook's `search()` converts the data back to native protobuf before returning it. Your existing operators *should* work as before, but due to the urgency of the v5 API being deprecated it was not tested too thoroughly. Therefore you should carefully evaluate your operator and hook functionality with this new version.
+
+   In order to use the API's new proto-plus format, you can use the `search_proto_plus()` method.
+
+   For more information, please consult google's migration document: https://developers.google.com/google-ads/api/docs/client-libs/python/library-version-10

Review comment:
       ```suggestion
      For more information, please consult `google-ads migration document <https://developers.google.com/google-ads/api/docs/client-libs/python/library-version-10>`__: 
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884859299


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-885032588


   Ah. We have some error with constraints because of the >=12.0 - I have to take a look and I know how to get rid of it in the future (it's false alarm basically) but for now, I will be able to merge it and regenerate constraints 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884918891


   > Actually since I made the default version of the API v8, it should be >=12.0.0 probably.
   
   Yep.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] infused-kim commented on pull request #17160: Google Ads Hook: Support newer versions of the google-ads library

Posted by GitBox <gi...@apache.org>.
infused-kim commented on pull request #17160:
URL: https://github.com/apache/airflow/pull/17160#issuecomment-884981769


   I have made the changes you requested. Could someone please review if the changelog message is appropriate? I could imagine you'd want to communicate the testing issue differently maybe.
   
   You can also just go ahead and make edits yourself if you prefer.
   
   And it looks like the build process is failing, because somewhere else version 4.0 of the google-ads library is requested. Did I miss updating it somewhere?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org