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



##########
File path: tests/cli/commands/test_user_command.py
##########
@@ -429,20 +428,20 @@ def test_cli_manage_roles_exceptions(self, 
create_user_test4, action, role, mess
                     "email": TEST_USER2_EMAIL,
                     "roles": [],
                 },
-                "Error: Can't load user \"{'username': 'imported_user2', 
'lastname': 'doe2', "
-                "'firstname': 'jon', 'email': '[email protected]', 
'roles': []}\". \nDetails:{'roles': "
-                "['Shorter than minimum length 1.']}",
+                "Error: Input file didn't pass validation. See below:\n"
+                "{0: {'roles': ['Shorter than minimum length 1.']}}",
             ],
             [
                 {
-                    "username": "imported_user3",
+                    "username1": "imported_user3",
                     "lastname": "doe3",
                     "firstname": "jon",
                     "email": TEST_USER3_EMAIL,
                 },
-                "Error: Can't load user \"{'username': 'imported_user3', 
'lastname': 'doe3', "
-                "'firstname': 'jon', 'email': '[email protected]'}\". 
\nDetails:{'roles': "
-                "['Missing data for required field.']}",
+                "Error: Input file didn't pass validation. See below:\n"
+                "{0: {'username': ['Missing data for required field.'], "
+                "'roles': ['Missing data for required field.'], "
+                "'username1': ['Unknown field.']}}",

Review comment:
       I think this is too raw and we need to format the message slightly, 
something like
   
   ```
   Error: Input file did not pass validation.
   [Item 0]
       username: Missing data for required field.
       roles: Missing data for required field.
       username1: Unknown field.
   ```
   
   Also need to account for
   
   1. When the input is not a list.
   2. When an item in the list is not a dict.




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