betodealmeida commented on a change in pull request #14064:
URL: https://github.com/apache/superset/pull/14064#discussion_r616883528
##########
File path: superset/commands/exceptions.py
##########
@@ -46,6 +46,11 @@ def add(self, exception: ValidationError) -> None:
def add_list(self, exceptions: List[ValidationError]) -> None:
self._invalid_exceptions.extend(exceptions)
+ def get_list_classnames(self) -> List[str]:
+ return list(
+ dict.fromkeys([ex.__class__.__name__ for ex in
self._invalid_exceptions])
+ )
+
Review comment:
```suggestion
def get_list_classnames(self) -> List[str]:
return list(set(ex.__class__.__name__ for ex in
self._invalid_exceptions))
```
##########
File path: superset/databases/commands/create.py
##########
@@ -92,6 +92,9 @@ def validate(self) -> None:
exception = DatabaseInvalidError()
exception.add_list(exceptions)
event_logger.log_with_context(
- action=f"db_connection_failed.{exception.__class__.__name__}"
+ action="db_connection_failed.{}.{}".format(
+ exception.__class__.__name__,
+ ".".join(exception.get_list_classnames()),
Review comment:
I think filtering duplicates make sense.
```suggestion
".".join(sorted(exception.get_list_classnames())),
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]