You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/19 16:28:57 UTC

[GitHub] [airflow] natanweinberger commented on a change in pull request #15425: Fix CLI connections import

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, should I avoid any dependencies on `secrets`? The existing function `load_connections_dict` calls a few helper functions. For example, it calls `_parse_secret_file`, which calls `_parse_[json,yaml,env]_file`.
   
   I can either:
   - move all these helper functions outside of `secrets/local_filesystem.py`
   - duplicate the same functionality in the cli module
   - add a method in the Connection class that still imports from secrets (but 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:
users@infra.apache.org