Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix extra insert for count on dataset creation #24625

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions superset/datasets/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,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(*)")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hughhhh would you mind linking to where this COUNT(*) metric is being created?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Updates columns and metrics from the datase
dataset.fetch_metadata(commit=False)
db.session.commit()
except (SQLAlchemyError, DAOCreateFailedError) as ex:
Expand Down
Loading