uranusjr commented on code in PR #33932:
URL: https://github.com/apache/airflow/pull/33932#discussion_r1312788415
##########
airflow/cli/commands/variable_command.py:
##########
@@ -86,7 +87,18 @@ def variables_import(args):
except JSONDecodeError:
raise SystemExit("Invalid variables file.")
suc_count = fail_count = 0
+ skipped = set()
+ action_on_existing = args.action_on_existing_key
+ if action_on_existing == "fail":
+ existing_key =
set(session.scalars(select(Variable.key).where(Variable.key.in_(var_json))))
+ if existing_key:
+ raise SystemExit(f"Failed. These keys:
{list(sorted(existing_key))} already exists.")
Review Comment:
```suggestion
raise SystemExit(f"Failed. These keys: {sorted(existing_key)}
already exists.")
```
--
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]