fix(import): Ensure import exceptions are logged (#32410)

This commit is contained in:
Paul Rhodes
2025-03-18 19:35:57 +00:00
committed by GitHub
parent 850801f510
commit bc3e19d0a2

View File

@@ -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,