Skip to content

Commit

Permalink
Fix mypy errors resulting from typing updates in marshmallow (#22044)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
potiuk committed Mar 7, 2022
1 parent 4e05bbc commit 2ab8f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/cli/commands/user_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down

0 comments on commit 2ab8f24

Please sign in to comment.