-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update secrets backends to use get_conn_value instead of get_conn_uri #22348
Update secrets backends to use get_conn_value instead of get_conn_uri #22348
Conversation
79a5d57
to
a39f54b
Compare
I REALLY ❤️ the attitude of thinking about the user experience and avoiding false positives when you have warnings when you can't disable them. I think having even a single of such warning is a major reason why people develop blind-spots that makes warnings useless. |
In apache#19857 we enabled storing connections as JSON instead of URI and renamed get_conn_uri to get_conn_value to be consistent with this change. The method get_conn_uri is now deprecated and should warn when used.
fe4d22a
to
48fe315
Compare
thanks @dstandish for that PR could be great to add to the doc a short code example that convert an URI airflow connection to JSON , so users ( and even myself ) could easily convert all their current connections secrets |
a reasonable suggestion but i think that will belong in a separate PR |
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
The apache#22348 introduced a change on how connections are retrieved from secret backends, but one of the tests has not been changed to follow. This fixes failing main.
The #22348 introduced a change on how connections are retrieved from secret backends, but one of the tests has not been changed to follow. This fixes failing main.
In #19857 we enabled storing connections as JSON instead of URI and renamed get_conn_uri to get_conn_value to be consistent with this change. The method get_conn_uri is now deprecated and should warn when used.
This PR updates secrets backends in providers to implement the new method, while retaining support for the old method for backcompat. We cannot remove the old methods until min airflow version is updated to 2.3 for the provider.
For users of Airflow versions older than 2.3 we suppress the deprecation warning since it's only from 2.3 onward that the warning makes sense (below 2.3, get_conn_uri is called; in 2.3 we call get_conn_value instead).