yossarian-p22 opened a new issue, #26136:
URL: https://github.com/apache/airflow/issues/26136

   ### Apache Airflow Provider(s)
   
   google
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-google==8.1.0
   
   ### Apache Airflow version
   
   2.2.5
   
   ### Operating System
   
   Debian GNU/Linux 10 (buster)
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   When running `GoogleAdsToGcsOperator` with parameter `attributes` containing 
string "type", an error occurs:
   ```
   [2022-09-02, 16:56:57 CEST] {ads.py:238} INFO - Fetched Google Ads Iterators
   [2022-09-02, 16:56:57 CEST] {ads.py:252} INFO - Extracting data from 
returned Google Ads Iterators
   [2022-09-02, 16:56:57 CEST] {ads_to_gcs.py:115} ERROR - An error occurred in 
converting the Google Ad Rows. 
    Error type
   [2022-09-02, 16:56:57 CEST] {taskinstance.py:1774} ERROR - Task failed with 
exception
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/google/ads/transfers/ads_to_gcs.py",
 line 113, in execute
       converted_rows = [getter(row) for row in rows]
     File 
"/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/google/ads/transfers/ads_to_gcs.py",
 line 113, in <listcomp>
       converted_rows = [getter(row) for row in rows]
   AttributeError: type
   ```
   String "type" (like ad_group_ad.ad.type) can be present in `query` parameter 
but causes error when present also in parameter `attributes`.
   
   ### What you think should happen instead
   
   Google Ads Rows should be converted the same way they are converted when 
string 'type' is not present in parameter `attributes`.
   
   ### How to reproduce
   
   Run `GoogleAdsToGcsOperator` with parameters:
   ```
   {
       "query": "SELECT ad_group_ad.ad.id, ad_group_ad.ad.name, 
ad_group_ad.ad.type, ad_group_ad.ad.url_custom_parameters, 
ad_group_ad.ad.image_ad.image_url, ad_group_ad.labels, 
ad_group_ad.ad.image_ad.name, ad_group_ad.ad.image_ad.preview_image_url, 
ad_group_ad.status, ad_group.id, campaign.id, customer.id FROM ad_group_ad 
WHERE segments.date DURING LAST_7_DAYS",
       "attributes": [
           "ad_group_ad.ad.id",
           "ad_group_ad.ad.name",
           "ad_group_ad.ad.type",
           "ad_group_ad.ad.url_custom_parameters",
           "ad_group_ad.ad.image_ad.image_url",
           "ad_group_ad.labels",
           "ad_group_ad.ad.image_ad.name",
           "ad_group_ad.ad.image_ad.preview_image_url",
           "ad_group_ad.status",
           "ad_group.id",
           "campaign.id",
           "customer.id"
       ]
   }
   ```
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to