Skip to content

unable to specify location in arguments to CloudBuildRunBuildTriggerOperator #31272

Description

@siddhsql

Apache Airflow version

Other Airflow 2 version (please specify below)

What happened

airflow version 2.4.3

when we try to specify location in argument to CloudBuildRunBuildTriggerOperator

code:

from airflow.providers.google.cloud.operators.cloud_build import (
    CloudBuildRunBuildTriggerOperator,
)

CloudBuildRunBuildTriggerOperator(
        task_id=task_id,
        project_id=PROJECT_ID,
        trigger_id=trigger_id,        
location=LOCATION,
        source={"project_id": PROJECT_ID, "repo_name": repo_url, "branch_name": "master"},
)

we get error:

Broken DAG: [/home/airflow/gcs/dags/xxx.py] Traceback (most recent call last):

  File "/opt/python3.8/lib/python3.8/site-packages/airflow/models/baseoperator.py", line 408, in apply_defaults

    result = func(self, **kwargs, default_args=default_args)

  File "/opt/python3.8/lib/python3.8/site-packages/airflow/models/baseoperator.py", line 756, in __init__

    raise AirflowException(

airflow.exceptions.AirflowException: Invalid arguments were passed to CloudBuildRunBuildTriggerOperator (task_id: iacv-common). Invalid arguments were:

**kwargs: {'location': 'us-central1'}

What you think should happen instead

the location should be honored

How to reproduce

run the code above

Operating System

Linux Debian

Versions of Apache Airflow Providers

2.4.3

Deployment

Google Cloud Composer

Deployment details

No response

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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions