withnale commented on code in PR #32410:
URL: https://github.com/apache/superset/pull/32410#discussion_r1991502798
##########
superset/commands/importers/v1/__init__.py:
##########
@@ -104,6 +107,8 @@ def validate(self) -> None: # noqa: F811
self._prevent_overwrite_existing_model(exceptions)
if exceptions:
+ for ex in exceptions:
+ logger.warning("Import Error: %s", ex)
raise CommandInvalidError(
Review Comment:
Exceptions is a list. The existing code path will just add an exception to
the log that looks like this....
```
2025-03-12
13:18:35,465:WARNING:superset.views.error_handling:CommandException
Traceback (most recent call last):
File "/Users/testuser/.venv/lib/python3.11/site-packages/flask/app.py",
line 1484, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/testuser/.venv/lib/python3.11/site-packages/flask/app.py",
line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/Users/testuser/.venv/lib/python3.11/site-packages/flask_appbuilder/security/decorators.py",
line 95, in wraps
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/testuser/superset/views/base_api.py", line 119, in wraps
duration, response = time_function(f, self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/testuser/superset/utils/core.py", line 1364, in time_function
response = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/testuser/superset/utils/log.py", line 303, in wrapper
value = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/Users/testuser/superset/views/base_api.py", line 106, in wraps
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/testuser/superset/dashboards/api.py", line 1408, in import_
command.run()
File
"/Users/testuser/superset/commands/dashboard/importers/dispatcher.py", line 57,
in run
command.run()
File "/Users/testuser/superset/utils/decorators.py", line 266, in wrapped
return on_error(ex)
^^^^^^^^^^^^
File "/Users/testuser/superset/utils/decorators.py", line 236, in on_error
raise ex
File "/Users/testuser/superset/utils/decorators.py", line 259, in wrapped
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/testuser/superset/commands/importers/v1/__init__.py", line
73, in run
self.validate()
File "/Users/testuser/superset/commands/importers/v1/__init__.py", line
107, in validate
raise CommandInvalidError(
superset.commands.exceptions.CommandInvalidError: Error importing dashboard
```
This log message tells me there was a problem importing the dashboard(s) but
gives me no context as to what the problems were. The exceptions list contains
all the individual errors associated with each resource that failed validation
but these are just discarded without the attached change.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]