From bc3e19d0a2bbf1d83d6d052507ede757eea960d3 Mon Sep 17 00:00:00 2001 From: Paul Rhodes Date: Tue, 18 Mar 2025 19:35:57 +0000 Subject: [PATCH] fix(import): Ensure import exceptions are logged (#32410) --- superset/commands/importers/v1/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/superset/commands/importers/v1/__init__.py b/superset/commands/importers/v1/__init__.py index 989c494b60f..be3bb92d0e7 100644 --- a/superset/commands/importers/v1/__init__.py +++ b/superset/commands/importers/v1/__init__.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +import logging from typing import Any, Optional from marshmallow import Schema, validate # noqa: F401 @@ -34,6 +35,8 @@ from superset.daos.base import BaseDAO from superset.models.core import Database # noqa: F401 from superset.utils.decorators import transaction +logger = logging.getLogger(__name__) + class ImportModelsCommand(BaseCommand): """Import models""" @@ -104,6 +107,8 @@ class ImportModelsCommand(BaseCommand): self._prevent_overwrite_existing_model(exceptions) if exceptions: + for ex in exceptions: + logger.warning("Import Error: %s", ex) raise CommandInvalidError( f"Error importing {self.model_name}", exceptions,