diff --git a/superset/datasets/commands/create.py b/superset/datasets/commands/create.py index 6349aa6bdbf74..71b283436055a 100644 --- a/superset/datasets/commands/create.py +++ b/superset/datasets/commands/create.py @@ -22,7 +22,6 @@ from sqlalchemy.exc import SQLAlchemyError from superset.commands.base import BaseCommand, CreateMixin -from superset.connectors.sqla.models import SqlMetric from superset.daos.dataset import DatasetDAO from superset.daos.exceptions import DAOCreateFailedError from superset.datasets.commands.exceptions import ( @@ -47,9 +46,7 @@ def run(self) -> Model: # Creates SqlaTable (Dataset) dataset = DatasetDAO.create(self._properties, commit=False) - # Updates columns and metrics from the dataset - dataset.metrics = [SqlMetric(metric_name="COUNT(*)", expression="COUNT(*)")] - + # Updates columns and metrics from the datase dataset.fetch_metadata(commit=False) db.session.commit() except (SQLAlchemyError, DAOCreateFailedError) as ex: diff --git a/superset/utils/pandas_postprocessing/prophet.py b/superset/utils/pandas_postprocessing/prophet.py index 6d733296adf54..8502363647d11 100644 --- a/superset/utils/pandas_postprocessing/prophet.py +++ b/superset/utils/pandas_postprocessing/prophet.py @@ -51,7 +51,7 @@ def _prophet_fit_and_predict( # pylint: disable=too-many-arguments Fit a prophet model and return a DataFrame with predicted results. """ try: - # pylint: disable=import-error,import-outside-toplevel + # pylint: disable=import-outside-toplevel from prophet import Prophet prophet_logger = logging.getLogger("prophet.plot")