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 2022/09/03 06:27:11 UTC

[GitHub] [airflow] tirkarthi commented on issue #26136: GoogleAdsToGcsOperator not handling properly `attributes` parameter with string "type"

tirkarthi commented on issue #26136:
URL: https://github.com/apache/airflow/issues/26136#issuecomment-1236059389

   It seems there is some inconsistency or issue in the library. Can you try using "ad_group_ad.ad.type_" in attributes?
   
   https://github.com/googleads/google-ads-python/blob/6b908c0db0d54214ac589e28810a0e8917eacd55/google/ads/googleads/v10/resources/types/ad.py#L275
   
   ```python
   python
   Python 3.7.13 (default, Aug 23 2022, 10:09:20) 
   [GCC 10.2.1 20210110] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import operator
   >>> getter_type = operator.attrgetter("ad_group_ad.ad.type")
   >>> getter_type_ = operator.attrgetter("ad_group_ad.ad.type_")
   >>> from google.ads.googleads.v10.services.types.google_ads_service import GoogleAdsRow
   >>> getter_type(GoogleAdsRow())
   Traceback (most recent call last):
     File "/usr/local/lib/python3.7/site-packages/proto/message.py", line 610, in __getattr__
       pb_type = self._meta.fields[key].pb_type
   KeyError: 'type'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/local/lib/python3.7/site-packages/proto/message.py", line 615, in __getattr__
       raise AttributeError(str(ex))
   AttributeError: 'type'
   >>> getter_type_(GoogleAdsRow())
   <AdType.UNSPECIFIED: 0>
   ```
   
   But using latest package from github works fine with "type" https://github.com/googleads/google-ads-python
   
   ```python
   python                
   Python 3.10.6 (main, Aug  2 2022, 15:11:28) [GCC 9.4.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> from google.ads.googleads.v10.services.types.google_ads_service import GoogleAdsRow
   >>> import operator
   >>> from google.ads.googleads.v10.services.types.google_ads_service import GoogleAdsRow
   >>> getter_type = operator.attrgetter("ad_group_ad.ad.type")
   >>> getter_type(GoogleAdsRow())
   <AdType.UNSPECIFIED: 0>
   ```


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