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/20 15:47:27 UTC

[GitHub] [airflow] rv-irosario opened a new issue #17111: apache-airflow-providers-google: google-ads-12.0.0

rv-irosario opened a new issue #17111:
URL: https://github.com/apache/airflow/issues/17111


   Hey team, I was looking to use the google ads hook but it seems like the google ads package is a bit out of date with the hook only taking "v5", "v4", "v3", "v2" https://developers.google.com/google-ads/api/docs/release-notes and all of those being deprecated. Is there any chance the provider can be upgraded to include this? here is the release note of https://github.com/googleads/google-ads-python/releases/tag/12.0.0 google's 12.0.0 release which also deprecated v5
   
   
   **Apache Airflow version**:  2.0.1
   
   
   **What happened**:
   
   <!-- (please include exact error messages if you can) -->
   
   **What you expected to happen**: return query data, instead, I get an error returned from the google ads v5 API:
   
   
   **How to reproduce it**: attempt to hit the v5 API endpoint
   
   
   
   **Anything else we need to know**: error is below
   ```
   Response
   -------
   Headers: {
     "google.ads.googleads.v5.errors.googleadsfailure-bin": "\nJ\n\u0002\b\u0001\u0012D Version v5 is deprecated. Requests to this version will be blocked.",
     "grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid argument.\u001a\u0001\nCtype.googleapis.com/google.ads.googleads.v5.errors.GoogleAdsFailure\u0012L\nJ\n\u0002\b\u0001\u0012D Version v5 is deprecated. Requests to this version will be blocked.",
     "request-id": "JyFZ9zysaqJbiCr_PX8SLA"
   }
   Fault: errors {
     error_code {
       request_error: UNKNOWN
     }
     message: " Version v5 is deprecated. Requests to this version will be blocked."
   }
   ```
   
   
   


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-883585978


   Would you like to make a PR and upgrade the dependency? It should be pretty much as easy as updating the dependency and fixing all errors that are resulting from that + runiing a system test with real GCP accoun to test it. Happy to guide in the process @rv-irosario 


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
infused-kim commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-884689337


   Today the Google v5 API stopped working. As a workaround until we get full compatibility with the latest google ads version, you can update the google-ads package to v8.0.0, which supports the v6 API that is still working.
   
   Unfortunately even though the hook is supposed to be compatible with google-ads up to v8.0.0, there is an import error:
   
   ```
   af_webserver |   File "/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/google/ads/hooks/ads.py", line 28, in <module>
   af_webserver |     from google.ads.google_ads.v2.types import GoogleAdsRow
   af_webserver | ModuleNotFoundError: No module named 'google.ads.google_ads.v2'
   ```
   
   This is due to the hook using a hardcoded v2 import. Changing it to v6 fixed the import error.
   
   You can do it using this patch file:
   ```patch
   --- /home/airflow/.local/lib/python3.7/site-packages/airflow/providers/google/ads/hooks/ads.py	2021-07-14 14:56:57.000000000 +0000
   +++ /home/airflow/.local/lib/python3.7/site-packages/airflow/providers/google/ads/hooks/ads_fixed.py	2021-07-22 06:21:47.989828054 +0000
   @@ -25,7 +25,7 @@
        from cached_property import cached_property
    from google.ads.google_ads.client import GoogleAdsClient
    from google.ads.google_ads.errors import GoogleAdsException
   -from google.ads.google_ads.v2.types import GoogleAdsRow
   +from google.ads.google_ads.v6.types import GoogleAdsRow
    from google.api_core.page_iterator import GRPCIterator
    from google.auth.exceptions import GoogleAuthError
    from googleapiclient.discovery import Resource
   @@ -76,7 +76,7 @@
        :rtype: list[GoogleAdsRow]
        """
   
   -    default_api_version = "v5"
   +    default_api_version = "v6"
   
        def __init__(
            self,
   ```
   
   As I am using docker, adding this to my Dockerfile resolved the issue for me:
   ```Dockerfile
   # Update google ads library to support non-deprecated API versions
   RUN pip install google-ads==8.0.0
   
   # Patch import errors in provider
   COPY patches/2021_07_af_google_ads_v6_fix.patch .
   RUN patch -d / -p0 < 2021_07_af_google_ads_v6_fix.patch
   ```
   


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-883611771


   Seems like you might have @Overbyrd to help you at least with testing. The more, the merrier !


-- 
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] rv-irosario commented on issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
rv-irosario commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-883587278


   for sure!


-- 
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 edited a comment on issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-883611771


   Seems like you might have @Overbryd to help you at least with testing. The more, the merrier !


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-883793326


   We had compatibility problem with newer version of Google ads library, because it requires Python 3.7 or newer, but we supports Python 3.6. Hopefully it has been fixed. They added support for Python 3.6 in 8.1.0. see: https://github.com/googleads/google-ads-python/pull/435


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-884323646


   > We had compatibility problem with newer version of Google ads library, because it requires Python 3.7 or newer, but we supports Python 3.6. Hopefully it has been fixed. They added support for Python 3.6 in 8.1.0. see: [googleads/google-ads-python#435](https://github.com/googleads/google-ads-python/pull/435)
   
   If this is a problem, I think I would be ok with making google ads providers not working in Py3.6 version. We could mark tests for those excluding running them for Py3.6 and make note in release notes about this incompatibility (and in setup.py we could add >python 3.6 for ads. There might be a problem with preparing provider packages using python 3.6 but I am already thinking to move them to Py3.7 as the end of life for Python 3.6 is getting closer (December 2021).


-- 
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] rv-irosario commented on issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
rv-irosario commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-884177034


   looks like the tag of 12.0.0 is the last compatible tag for 3.6 


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-883499576


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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 closed issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #17111:
URL: https://github.com/apache/airflow/issues/17111


   


-- 
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 issue #17111: apache-airflow-providers-google: google-ads-12.0.0

Posted by GitBox <gi...@apache.org>.
infused-kim commented on issue #17111:
URL: https://github.com/apache/airflow/issues/17111#issuecomment-884863829


   The PR above makes the hook compatible with newer versions of the google-ads API.
   
   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.
   
   You can get more information about that here:
   https://developers.google.com/google-ads/api/docs/client-libs/python/library-version-10
   
   ## Prioritization thoughts
   Google completely stopped supporting the v5 API as of today. This means that the integrations of everyone who is using this hook are broken now.  
   
   So perhaps it's worth considering to do an expedited release of the update to the google provider.


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