You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/03/07 10:30:49 UTC

[airflow] branch main updated: Fix mypy errors resulting from typing updates in marshmallow (#22044)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2ab8f24  Fix mypy errors resulting from typing updates in marshmallow (#22044)
2ab8f24 is described below

commit 2ab8f243fecc31d7906dd89896cd0f041e7971cb
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Mon Mar 7 11:29:38 2022 +0100

    Fix mypy errors resulting from typing updates in marshmallow (#22044)
    
    Marshmallow library has now better typing and mypy detected
    a potential problem with messages not always being dict in
    ValidationError. Switched to normalized_messages to fix it.
---
 airflow/cli/commands/user_command.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/cli/commands/user_command.py b/airflow/cli/commands/user_command.py
index 85c11d6..ddbb7cf 100644
--- a/airflow/cli/commands/user_command.py
+++ b/airflow/cli/commands/user_command.py
@@ -198,7 +198,7 @@ def _import_users(users_list: List[Dict[str, Any]]):
         UserSchema(many=True).load(users_list)
     except ValidationError as e:
         msg = []
-        for row_num, failure in e.messages.items():
+        for row_num, failure in e.normalized_messages().items():
             msg.append(f'[Item {row_num}]')
             for key, value in failure.items():
                 msg.append(f'\t{key}: {value}')