Skip to content

Google vendored-in googleads missed one import #30526

Description

@collinmcnulty

Apache Airflow Provider(s)

google

Versions of Apache Airflow Providers

8.12.0

Apache Airflow version

2.5.3

Operating System

Debian GNU/Linux 11 (bullseye)

Deployment

Astronomer

Deployment details

Using the Astro CLI. I can provide full requirements.txt if needed.

What happened

Using the latest google provider to access v13 of Google Ads API, but calls are blocked saying that Specified Google Ads API version "v13" does not exist. Valid API versions are: "v13", "v12", "v11"

What you think should happen instead

Calls to the API should go through without error. This vendored version, does, I believe, allow v13, but is using an outdated check because the check is importing the older, non-vendored-in googleads package.

How to reproduce

>>> from airflow.providers.google_vendor.googleads.client import GoogleAdsClient
>>> GoogleAdsClient._get_api_services_by_version("v13")

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/airflow/providers/google_vendor/googleads/client.py", line 203, in _get_api_services_by_version
    version_module = import_module(f"airflow.providers.google_vendor.googleads.{version}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'airflow.providers.google_vendor.googleads.v13'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/airflow/providers/google_vendor/googleads/client.py", line 205, in _get_api_services_by_version
    raise ValueError(
ValueError: Specified Google Ads API version "v13" does not exist. Valid API versions are: "v13", "v12", "v11"

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions