You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dv-matthew-crown (via GitHub)" <gi...@apache.org> on 2026/01/29 10:39:46 UTC
[I] incorrect connection import in airflow cli connection command [airflow]
dv-matthew-crown opened a new issue, #61201:
URL: https://github.com/apache/airflow/issues/61201
### Apache Airflow version
3.1.6
### If "Other Airflow 3 version" selected, which one?
_No response_
### What happened?
When using Airflow connections defined from json, airflow uses [Ref](https://github.com/apache/airflow/blob/f4050b8aef22b68be81ece9d742d54d9e47b05b0/airflow-core/src/airflow/cli/commands/connection_command.py#L260):
`new_conn = Connection.from_json(conn_id=args.conn_id, value=args.conn_json)`
Giving a deprecated warning:
`Using Connection.from_json from `airflow.models` is deprecated.Please use `from_json` on Connection from sdk(airflow.sdk.Connection) instead category=DeprecationWarning`
### What you think should happen instead?
Per the deprecation warning, the import [here](https://github.com/apache/airflow/blob/f4050b8aef22b68be81ece9d742d54d9e47b05b0/airflow-core/src/airflow/cli/commands/connection_command.py#L36)
should be
`from airflow.sdk import Connection`
### How to reproduce
Define a connection via json
### Operating System
Ubuntu 24.04.3 LTS
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] incorrect connection import in airflow cli connection command [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on issue #61201:
URL: https://github.com/apache/airflow/issues/61201#issuecomment-3817935106
@dv-matthew-crown it's a little more than that for CLI. Over time, remote commands like `airflow connections x` will be replaced with `airflowctl`: https://airflow.apache.org/blog/airflowctl-0.1.0/, while we should not issue deprecation warnings in our code, I think we are OK with this instance.
We do not want to tie the airflow core code with task sdk.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] incorrect connection import in airflow cli connection command [airflow]
Posted by "tirkarthi (via GitHub)" <gi...@apache.org>.
tirkarthi commented on issue #61201:
URL: https://github.com/apache/airflow/issues/61201#issuecomment-3817786495
The deprecation message was updated in https://github.com/apache/airflow/pull/54868 .
cc: @amoghrajesh
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] incorrect connection import in airflow cli connection command [airflow]
Posted by "dv-matthew-crown (via GitHub)" <gi...@apache.org>.
dv-matthew-crown closed issue #61201: incorrect connection import in airflow cli connection command
URL: https://github.com/apache/airflow/issues/61201
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org