Closed graceguo-supercat closed 2 years ago
Hi @graceguo-supercat, can you attach a screenshot with all the control select. I assume you set filters and groud-by as well?
Couple PRs touched Pivot table lately. may need some help debugging. sorry about the regression. https://github.com/apache-superset/superset-ui/pull/954 https://github.com/apache/superset/pull/13057 (more likely?)
cc @villebro
I don't believe this is a regression - this has most likely always been the case. I agree that the proposal is the correct way to filter the data. I believe we should be able to do this by leveraging the timeseries_limit
(although I'd really like to refactor this so that the feature isn't related to timeseries): https://github.com/apache/superset/blob/5fca19da565cae1e70a0dff66007828dbe9fc8ed/superset/connectors/sqla/models.py#L1177-L1224
@junlincc this is controls list:
@villebro are there any concerns of merely adding a SERIES LIMIT
control per your suggestion?
Actually @villebro adding the SERIES LIMIT
might not be the right approach, i.e., when prototyping the change the limit adheres to the row limit of the groupings of both the GROUP BY
and COLUMNS
which is likely not what the user is after. Grepping through the code it seems non trivial to decouple this logic.
How to reproduce the bug
VIEW QUERY
Actual results
Instead of filtering out the top K rows in the superset view, it filters out the top K rows in the input data; this results in the pivot table having lots of missing cells.
Expected results
Superset should generate a sub-query with limit like this:
Environment
latest master branch
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
Add any other context about the problem here. cc @junlincc @zuzana-vej