Eason09053360 commented on code in PR #72958:
URL: https://github.com/apache/airflow/pull/72958#discussion_r4073037161


##########
airflow-core/src/airflow/cli/commands/variable_command.py:
##########
@@ -169,12 +169,12 @@ def variables_import(args, *, session: Session = 
NEW_SESSION):
         else:
             suc_count += 1
     print(f"{suc_count} of {len(var_json)} variables successfully updated.")
-    if fail_count:
-        print(f"{fail_count} variable(s) failed to be updated.")
     if skipped:
         print(
-            f"The variables with these keys: {list(sorted(skipped))} were 
skipped because they already exists"
+            f"The variables with these keys: {list(sorted(skipped))} were 
skipped because they already exist"
         )
+    if fail_count:
+        raise SystemExit(f"{fail_count} variable(s) failed to be updated.")

Review Comment:
   `pools import`, the sibling this mirrors, names what failed (`Failed to 
update pool(s): {', '.join(failed)}`). Collecting the keys in the `except` 
above and listing them here would make a 200-variable import actionable — a 
count alone might isn't enough?



##########
airflow-core/src/airflow/cli/commands/variable_command.py:
##########


Review Comment:
   ```suggestion
               print(f"Variable import failed for key {k!r}: {e!r}")
   ```



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