sarahamilton opened a new issue #14075:
URL: https://github.com/apache/airflow/issues/14075


   **Apache Airflow version**: 1.10.12
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**: Google Cloud Composer 1.13.3
   
   - **Cloud provider or hardware configuration**:
   - Google Cloud Composer
   
   **What happened**:
   The GoogleDisplayVideo360SDFtoGCSOperator is not able to download media. The 
operator calls the [download_media 
hook](https://github.com/apache/airflow/blob/10c026cb7a7189d9573f30f2f2242f0f76842a72/airflow/providers/google/marketing_platform/hooks/display_video.py#L237)
 and should pass in the name of the media resource to download. However, it is 
currently passing in the full resource object. This breaks the API call to 
download_media. The [API spec is 
here](https://developers.google.com/display-video/api/reference/rest/v1/media/download),
 for reference. Thus, the operator will fail every time.
   
   An example error -- as you can see, it's requesting the full object in the 
path instead of just "sdfdownloadtasks/media/25447314'":  
   `ERROR - <HttpError 404 when requesting 
https://displayvideo.googleapis.com/download/%7B'name':%20'sdfdownloadtasks/operations/25447314',%20'metadata':%20%7B'@type':%20'type.googleapis.com/google.ads.displayvideo.v1.SdfDownloadTaskMetadata',%20'createTime':%20'2021-02-03T16:57:20.950Z',%20'endTime':%20'2021-02-03T16:57:52.898Z',%20'version':%20'SDF_VERSION_5_1'%7D,%20'done':%20True,%20'response':%20%7B'@type':%20'type.googleapis.com/google.ads.displayvideo.v1.SdfDownloadTask',%20'resourceName':%20'sdfdownloadtasks/media/25447314'%7D%7D?alt=media
 returned "Resource "{'name': 'sdfdownloadtasks/operations/25447314', 
'metadata': {'@type': 
'type.googleapis.com/google.ads.displayvideo.v1.SdfDownloadTaskMetadata', 
'createTime': '2021-02-03T16:57:20.950Z', 'endTime': 
'2021-02-03T16:57:52.898Z', 'version': 'SDF_VERSION_5_1'}, 'done': True, 
'response': {'@type': 
'type.googleapis.com/google.ads.displayvideo.v1.SdfDownloadTask', 
'resourceName': 'sdfdownloadtasks/media/25447314'}}" cannot be f
 ound.">` 
   
   **What you expected to happen**: The GoogleDisplayVideo360SDFtoGCSOperator 
should only pass in the resourceName and correctly download the file.
   
   **How to reproduce it**: Run any workflow requesting to download an SDF 
file. 
   
   
   **Anything else we need to know**: I have written a patch and will submit it 
shortly.


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

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


Reply via email to