You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2023/07/10 16:55:18 UTC

[superset] branch master updated: fix: fix extra insert for count on dataset creation (#24625)

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e6e8276a20 fix: fix extra insert for count on dataset creation (#24625)
e6e8276a20 is described below

commit e6e8276a203151d979c1a86b2f9364aac9463bb1
Author: Hugh A. Miles II <hu...@gmail.com>
AuthorDate: Mon Jul 10 12:55:11 2023 -0400

    fix: fix extra insert for count on dataset creation (#24625)
---
 superset/datasets/commands/create.py            | 5 +----
 superset/utils/pandas_postprocessing/prophet.py | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/superset/datasets/commands/create.py b/superset/datasets/commands/create.py
index 6349aa6bdb..71b2834360 100644
--- a/superset/datasets/commands/create.py
+++ b/superset/datasets/commands/create.py
@@ -22,7 +22,6 @@ from marshmallow import ValidationError
 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 @@ class CreateDatasetCommand(CreateMixin, BaseCommand):
             # 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 a23f7838bf..47d956fed5 100644
--- a/superset/utils/pandas_postprocessing/prophet.py
+++ b/superset/utils/pandas_postprocessing/prophet.py
@@ -52,7 +52,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")