Skip to content

GoogleDisplayVideo360 (hooks|operators|sensors) aren't compatible with v2 of the Display & Video 360 API #28045

Description

@github-sang

Apache Airflow Provider(s)

google

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

  1. Create a Cloud Composer instance
  2. Create a DAG that calls a GoogleDisplayVideo360 operator (e.g. GoogleDisplayVideo360CreateReportOperator) with api_version='v2' as a param
  3. Upload DAG to Composer DAG folder
  4. Trigger DAG

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions