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


##########
airflow/cli/commands/connection_command.py:
##########
@@ -195,6 +212,16 @@ def connections_add(args):
     if has_json and has_uri:
         raise SystemExit('Cannot supply both conn-uri and conn-json')
 
+    if has_type:
+        is_valid_conn_type = _valid_conn_type(args.conn_type)
+        if not is_valid_conn_type:
+            warnings.warn(f'The type provided to --conn-type is invalid: 
{args.conn_type}')
+            warnings.warn(
+                f'Supported --conn-types are:{_get_connection_types()}.'
+                'Hence overriding the conn-type with generic'
+            )

Review Comment:
   Not sure `warnings.warn` is the right thing to do (not faimilar with how 
commands log things). Maybe `log.warning` is better?



-- 
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: [email protected]

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

Reply via email to