airflow icon indicating copy to clipboard operation
airflow copied to clipboard

more explicit secrets path error messages (#55015)

Open FoxHelms opened this issue 1 month ago • 2 comments


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

FoxHelms avatar Dec 08 '25 23:12 FoxHelms

For reference: https://github.com/apache/airflow/issues/55015

BasPH avatar Dec 09 '25 09:12 BasPH

Got it @BasPH, thanks for the feedback! I implemented your suggestion. I've tried to also test that the logger shows the correct warning, but I've been having trouble mocking it because its a BoundLoggerLazyProxy. Is this test sufficient?

FoxHelms avatar Dec 10 '25 02:12 FoxHelms

Tested this exact scenario on a live Vault, looking good: image

Will check the unit test next

BasPH avatar Dec 11 '25 14:12 BasPH

@FoxHelms Can we replicate this check for fetching connections (which requires key "conn_uri") and config too?

BasPH avatar Dec 11 '25 14:12 BasPH

@BasPH I just updated get_config and get_connection. I'm not sure how to test get_connection because the function always returns a connection, and get_uri always returns a string. Maybe that unit test is unnecessary and displaying the warning message is sufficient?

FoxHelms avatar Dec 11 '25 20:12 FoxHelms

All changes made!

FoxHelms avatar Dec 17 '25 18:12 FoxHelms