airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Swap 'connections_test' CLI to use Connection instead of BaseHook

Open amoghrajesh opened this issue 7 months ago • 0 comments

To ease effort on moving BaseHook to task sdk, noticed that this one could be an issue.

It can just use the Connection layer instead of using the BaseHook. BaseHook returned a Connection earlier and we anyways did a test_connection on it below: https://github.com/apache/airflow/compare/main...astronomer:airflow:dont-use-hook-in-test-connection?expand=1#diff-dac3064a790b9fc69e43692362250d0144934c4e217a65b9a47eacb23c822671R378

root@81e35b442509:/opt/airflow# airflow connections test postgres_default
Retrieving connection: 'postgres_default'

Testing...

Connection success

^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

amoghrajesh avatar Jun 17 '25 10:06 amoghrajesh