Skip to content

Airflow3. URI field does not exist for Connection imported from task-sdk. #49881

@MaksYermak

Description

@MaksYermak

Apache Airflow version

3.0.0

If "Other Airflow 2 version" selected, which one?

No response

What happened?

I was trying to replace the import for Connection from from airflow.models import Connection to from airflow.sdk import Connection for making cloud_sql Hook compatible with Airflow 3 and Airflow 2. And I have gotten the error that the uri field does not exist for Connection imported from task-sdk.

It means for me that in the current time we can't replace the code for cloud_sql hook here: https://github.com/apache/airflow/blob/main/providers/google/src/airflow/providers/google/cloud/hooks/cloud_sql.py#L1122. This parameter is an important parameter for establishing a connection for CloudSQL operators. And when in the future we remove the ability for importing Connection from the models these operators will be broke.

What you think should happen instead?

In my opinion Connection from task-sdk and models should have the same fields and interface.

How to reproduce

For cloud_sql hook replace the import from from airflow.models import Connection to from airflow.sdk import Connection. After that run test_cloud_sql unit test.

Operating System

Ubuntu

Versions of Apache Airflow Providers

No response

Deployment

Other

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions