-
Notifications
You must be signed in to change notification settings - Fork 16.8k
GoogleDisplayVideo360 (hooks|operators|sensors) aren't compatible with v2 of the Display & Video 360 API #28045
Description
Apache Airflow Provider(s)
Versions of Apache Airflow Providers
apache-airflow-providers-google 8.4.0
Apache Airflow version
airflow-2.3.4
Operating System
Ubuntu 18.04.6 LTS
Deployment
Composer
Deployment details
Create a new Google Cloud Composer environment (image version composer-1.19.15-airflow-2.3.4)
What happened
Attempting to run any DAG that uses the GoogleDisplayVideo360 (hooks|operators|sensors) trying to connect to v2 of the API (https://developers.google.com/bid-manager/reference/rest) results in the DAG failing with the following error in the log:
[2022-12-01, 23:54:02 UTC] {base.py:68} INFO - Using connection ID 'google_cloud_default' for task execution.
[2022-12-01, 23:54:02 UTC] {display_video.py:103} INFO - Creating Display & Video 360 report.
[2022-12-01, 23:54:02 UTC] {credentials_provider.py:325} INFO - Getting connection usinggoogle.auth.default()since no key file is defined for hook.
[2022-12-01, 23:54:02 UTC] {taskinstance.py:1904} ERROR - Task failed with exception
Traceback (most recent call last):
File "/opt/python3.8/lib/python3.8/site-packages/airflow/providers/google/marketing_platform/operators/display_video.py", line 104, in execute
response = hook.create_query(query=self.body)
File "/opt/python3.8/lib/python3.8/site-packages/airflow/providers/google/marketing_platform/hooks/display_video.py", line 96, in create_query
response = self.get_conn().queries().createquery(body=query).execute(num_retries=self.num_retries)
AttributeError: 'Resource' object has no attribute 'createquery'
[2022-12-01, 23:54:02 UTC] {taskinstance.py:1408} INFO - Marking task as FAILED. dag_id=dv360_v2_report, task_id=create_dv2_report, execution_date=20221201T235355, start_date=20221201T235401, end_date=20221201T235402
[2022-12-01, 23:54:02 UTC] {standard_task_runner.py:92} ERROR - Failed to execute job 9 for task create_dv2_report ('Resource' object has no attribute 'createquery'; 866)
[2022-12-01, 23:54:02 UTC] {local_task_job.py:156} INFO - Task exited with return code 1
What you think should happen instead
The operator should connect to version 2 of the Display & Video 360 API successfully and execute the operation
How to reproduce
- Create a Cloud Composer instance
- Create a DAG that calls a GoogleDisplayVideo360 operator (e.g. GoogleDisplayVideo360CreateReportOperator) with
api_version='v2'as a param - Upload DAG to Composer DAG folder
- Trigger DAG
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct