Skip to content

GoogleAdsToGcsOperator sends default headers which is no longer supported by the API #43486

@shervinrad100

Description

@shervinrad100

Apache Airflow Provider(s)

google

Versions of Apache Airflow Providers

10.21.1

Apache Airflow version

Version 2.0

Operating System

Debian GNU/Linux 12 (bookworm)

Deployment

Docker-Compose

Deployment details

Pretty standard docker-compose up. In the docker compose mounted the volumes to the standard directories and set some variables to be loaded into xcoms (eg user, gcs_conn_id). Nothing's customised otherwise.

What happened

I wanted to test GoogleAdsToGcsOperator and I wrote a GAQL query to hit the customer_client resource and the task failed with the following error:

Fault: errors {
  error_code {
    request_error: PAGE_SIZE_NOT_SUPPORTED
  }
  message: "Setting the page size is not supported. Search Responses will have fixed page size of \'10000\' rows."
}

I did not specify any page size (this is initialised here)

This was the task I ran in my DAG:

# I get these from xcoms. It's loaded in with docker-compose
DEFAULT_ARGS = {
    # connections
    'gcp_conn_id': 'google_cloud_default', 
    'google_ads_conn_id': 'google_ads_conn',
    'retries': 2
}

GoogleAdsToGcsOperator(
        task_id='get_google_ads_sub_accounts',
        bucket=BUCKET,
        obj=file_path,
        api_version=API_VERSION, # v17
        gzip=False,
        # default_args=DEFAULT_ARGS,
        client_ids=[MCC_ACCOUNT_ID], # MCC accountID
        attributes=[
            "customer_client.descriptive_name"
            , "customer_client.id"
            , "customer_client.manager"
            , "customer.id"
            , "customer_client.hidden"
            , "customer_client.status"
        ],
        query="""
            SELECT customer_client.descriptive_name
                 , customer_client.id
                 , customer_client.manager
                 , customer.id
                 , customer_client.hidden
                 , customer_client.status
            FROM customer_client
            WHERE customer_client.status NOT IN ('CANCELED', 'CLOSED')
            """
    )

What you think should happen instead

a file should be created in my GCS bucket with the request response.

How to reproduce

If you run the following task with your connection ID information you would probably get the same error. Do not set the page_size parameter so that the init func passes the default.

Anything else

The entire request response headers are:

Headers: {
  "google.ads.googleads.v17.errors.googleadsfailure-bin": "\ni\n\u0002\b(\u0012cSetting the page size is not supported. Search Responses will have fixed page size of '10000' rows.\u0012\u0016kUF6eMWJI6-xDnmxB7Dhww",
  "grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid argument.\u001a\u0001\nDtype.googleapis.com/google.ads.googleads.v17.errors.GoogleAdsFailure\u0012\u0001\ni\n\u0002\b(\u0012cSetting the page size is not supported. Search Responses will have fixed page size of '10000' rows.\u0012\u0016kUF6eMWJI6-xDnmxB7Dhww",
  "request-id": ""
}
Fault: errors {
  error_code {
    request_error: PAGE_SIZE_NOT_SUPPORTED
  }
  message: "Setting the page size is not supported. Search Responses will have fixed page size of \'10000\' rows."
}

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions