mirror of
https://github.com/apache/superset.git
synced 2026-06-08 00:59:17 +00:00
fix(import): Ensure import exceptions are logged (#32410)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user