more explicit secrets path error messages (#55015)
^ 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.
For reference: https://github.com/apache/airflow/issues/55015
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?
Tested this exact scenario on a live Vault, looking good:
Will check the unit test next
@FoxHelms Can we replicate this check for fetching connections (which requires key "conn_uri") and config too?
@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?
All changes made!