uranusjr commented on a change in pull request #18590:
URL: https://github.com/apache/airflow/pull/18590#discussion_r732926102



##########
File path: airflow/cli/commands/user_command.py
##########
@@ -197,7 +197,13 @@ def _import_users(users_list: List[Dict[str, Any]]):
     try:
         UserSchema(many=True).load(users_list)
     except ValidationError as e:
-        raise SystemExit(f"Error: Input file didn't pass validation. See 
below:\n{e}")
+        msg = []
+        failures = e.messages
+        for row_num in failures:
+            msg.append(f'[Item {row_num}]')
+            for key in failures[row_num]:
+                msg.append(f'\t{key}: {failures[row_num][key]}')

Review comment:
       ```suggestion
           for row_num, row_failures in failures.items():
               msg.append(f'[Item {row_num}]')
               for key, failure in row_failures.items():
                   msg.append(f'\t{key}: {failure}')
   ```




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