bugraoz93 commented on code in PR #62702:
URL: https://github.com/apache/airflow/pull/62702#discussion_r2874809532
##########
airflow-ctl/src/airflowctl/ctl/commands/connection_command.py:
##########
@@ -59,10 +59,11 @@ def import_(args, api_client=NEW_API_CLIENT) -> None:
)
for k, v in connections_json.items()
}
+ action_on_existence =
BulkActionOnExistence(args.action_on_existing_key)
connection_create_action = BulkCreateActionConnectionBody(
action="create",
entities=list(connections_data.values()),
- action_on_existence=BulkActionOnExistence("fail"),
+ action_on_existence=action_on_existence,
Review Comment:
```suggestion
action_on_existence=BulkActionOnExistence(args.action_on_existing_key),
```
This can be more straightforward, since it won't be used more than two
times, no need for a variable and additional address :) (Connected with above
deletion)
##########
airflow-ctl/src/airflowctl/ctl/cli_config.py:
##########
@@ -275,6 +275,15 @@ def __call__(self, parser, namespace, values,
option_string=None):
choices=("overwrite", "fail", "skip"),
)
+# Common import action arg (for pools, connections)
+ARG_ACTION_ON_EXISTING_KEY = Arg(
Review Comment:
I think we have the same parameter. Maybe we can update the name of it and
pass it to the Variable command as well. Should be a couple of line changes.
What do you think?
`ARG_VARIABLE_ACTION_ON_EXISTING_KEY` let's not double them here as they are
the same on API side as well from BulkAction
##########
airflow-ctl/src/airflowctl/ctl/commands/connection_command.py:
##########
@@ -59,10 +59,11 @@ def import_(args, api_client=NEW_API_CLIENT) -> None:
)
for k, v in connections_json.items()
}
+ action_on_existence =
BulkActionOnExistence(args.action_on_existing_key)
Review Comment:
```suggestion
```
--
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]