Skip to content

Commit

Permalink
fix: fix extra insert for count on dataset creation (apache#24625)
Browse files Browse the repository at this point in the history
(cherry picked from commit e6e8276)
  • Loading branch information
hughhhh authored and sadpandajoe committed Jul 10, 2023
1 parent 2340a16 commit 0a9ce86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions superset/datasets/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion superset/utils/pandas_postprocessing/prophet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0a9ce86

Please sign in to comment.