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 2023/01/05 05:40:50 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #28738: Add --overwrite option to `connections import` CLI command

uranusjr commented on code in PR #28738:
URL: https://github.com/apache/airflow/pull/28738#discussion_r1062125362


##########
airflow/cli/commands/connection_command.py:
##########
@@ -301,19 +301,26 @@ def connections_delete(args):
 def connections_import(args):
     """Imports connections from a file."""
     if os.path.exists(args.file):
-        _import_helper(args.file)
+        _import_helper(args.file, args.overwrite)
     else:
         raise SystemExit("Missing connections file.")
 
 
-def _import_helper(file_path):
-    """Load connections from a file and save them to the DB. On collision, skip."""
+def _import_helper(file_path, overwrite):
+    """
+    Load connections from a file and save them to the DB.
+    If `overwrite` is set to true, overwrite on collision.
+    """

Review Comment:
   ```suggestion
   def _import_helper(file_path: str, overwrite: bool) -> None:
       """Load connections from a file and save them to the DB.
   
       :param overwrite: Whether to skip or overwrite on collision.
       """
   ```



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org