Skip to content

Conversation

@anishgirianish
Copy link
Contributor

@anishgirianish anishgirianish commented Dec 30, 2025


This PR fixes the /connections/test route in Airflow v3 to handle masked passwords correctly and ensures DBT hooks test connections without errors.

What/Why

  • Use stored password for saved connections instead of the masked "***".
  • If the connection is not saved, create a transient in-memory connection from the request body.
  • Fix DBT hook to use the correct connection URL during testing and avoid 400 errors.

How

  • Fetch the connection from the DB if connection_id is provided; otherwise, create a transient connection.
  • Added unit tests to cover saved and transient connections.
  • Updated dbt hook to use correct url

Impact

  • Fixes saved and transient connection testing failures and resolves DBT hook 400 errors.
  • Earlier versions are also affected and will require separate backports or PRs. The issue is specifically reported in 2.x version

closes: #58941
related: #58941


^ 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.

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anishgirianish Why did you close this PR, do you plan to work on a followup? I think this still needs to be fixed.

@pierrejeambrun
Copy link
Member

Ah maybe because there was #59643 opened already. Cool

@anishgirianish
Copy link
Contributor Author

Hi @pierrejeambrun Apologies for replying late. thank you so much for your reply. I figured only after opening this pr that there was already a Pr open with similar approach as this. Also going through discussion I saw desirable way of implementing it and thought closing this out. I am very intrested to work on a proposal for the discussed approach in #59643 if work has not been started on that. If so would like to request you for the assignment thank you.

@pierrejeambrun
Copy link
Member

@anishgirianish You don't need any assignment. You can just start working on a PR, I'd be glad to review it for the short term fix so people have a workaround while we work on the long term fix option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbt-cloud test_connection giving 400 response code

2 participants