natanweinberger commented on a change in pull request #15425:
URL: https://github.com/apache/airflow/pull/15425#discussion_r615999812



##########
File path: airflow/cli/commands/connection_command.py
##########
@@ -29,7 +29,7 @@
 from airflow.exceptions import AirflowNotFoundException
 from airflow.hooks.base import BaseHook
 from airflow.models import Connection
-from airflow.secrets.local_filesystem import _create_connection, 
load_connections_dict
+from airflow.secrets.local_filesystem import load_connections_dict

Review comment:
       Thanks for taking a look. I can add `Connection.from_dict`.
   
   For the implementation, in order to avoid any dependencies on `secrets`, 
I'll need to move several helper functions. The existing function 
`load_connections_dict` accepts a filepath and relies on `_parse_secret_file`, 
which calls `_parse_[json,yaml,env]_file` to read the file contents and 
deserialize them.
   
   I can either:
   - move all these helper functions outside of `secrets/local_filesystem.py` 
(if so, into a utils file perhaps)
   - duplicate the same functionality in the cli module (seems like a bad idea)
   - create the method in the Connection class, but still import from `secrets` 
(doesn't eliminate the dependency)
   
   What do you have in mind? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to