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: echarts timeseries groupby #11103

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

villebro
Copy link
Member

@villebro villebro commented Sep 29, 2020

SUMMARY

Bump ECharts viz plugin to 0.15.4 to fix a bug affecting the groupby control (apache-superset/superset-ui#800). Also add support for pivoting non-string column values.

TEST PLAN

Local testing + CI + new tests

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@@ -718,6 +718,7 @@ class ChartDataQueryObjectSchema(Schema):
)
groupby = fields.List(
fields.String(description="Columns by which to group the query.",),
allow_none=True,
Copy link
Member Author

Choose a reason for hiding this comment

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

QueryObject automatically does self.groupby = groupby or [] in the constructor, so no need to require a fields.List.

@@ -782,7 +783,7 @@ class ChartDataQueryObjectSchema(Schema):
description="Reverse order. Default: `false`", required=False
)
extras = fields.Nested(ChartDataExtrasSchema, required=False)
columns = fields.List(fields.String(), description="",)
columns = fields.List(fields.String(), description="", allow_none=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

Same for columns as groupby.

Copy link
Member

Choose a reason for hiding this comment

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

nit could be nice to add a description to columns and extras

if len(aggregates) == 1 and len(column) > 1:
# drop aggregate for single aggregate pivots with multiple groupings
# from column name (aggregates always come first in column name)
column = column[1:]
return ", ".join(column)
return ", ".join([str(col) for col in column])
Copy link
Member Author

Choose a reason for hiding this comment

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

It's a shame we have to format everything as strings for now, but hoping to remedy this once we move on to some other serialization format than JSON.

@codecov-commenter
Copy link

Codecov Report

Merging #11103 into master will decrease coverage by 0.83%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11103      +/-   ##
==========================================
- Coverage   61.36%   60.52%   -0.84%     
==========================================
  Files         383      383              
  Lines       24188    24186       -2     
==========================================
- Hits        14842    14638     -204     
- Misses       9346     9548     +202     
Flag Coverage Δ
#python 60.52% <100.00%> (-0.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/charts/schemas.py 100.00% <100.00%> (ø)
superset/utils/pandas_postprocessing.py 77.22% <100.00%> (+0.26%) ⬆️
superset/views/database/views.py 62.30% <0.00%> (-25.14%) ⬇️
superset/db_engine_specs/sqlite.py 65.62% <0.00%> (-9.38%) ⬇️
superset/db_engine_specs/presto.py 73.27% <0.00%> (-8.69%) ⬇️
superset/databases/commands/create.py 82.97% <0.00%> (-8.52%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/db_engine_specs/base.py 80.05% <0.00%> (-7.28%) ⬇️
superset/sql_validators/base.py 93.33% <0.00%> (-6.67%) ⬇️
superset/views/database/forms.py 83.33% <0.00%> (-5.56%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b458ac...c059d1f. Read the comment docs.

@villebro villebro merged commit 80e3955 into apache:master Sep 29, 2020
@villebro villebro deleted the villebro/echarts-groupby branch September 29, 2020 11:25
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* fix: echarts timeseries groupby

* address review comment
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants