Charts built off Snowflake only support uppercase metric labels
See original GitHub issueMake sure these boxes are checked before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven’t found one similar.
Superset version
0.31.1
Expected results
Chart should render without error when metric is given a non-uppercase label.
Actual results
Chart fails to render when metric is given a non-uppercase label. Stacktrace is as follows:
Traceback (most recent call last):
File "/home/superset/superset/views/base.py", line 114, in wraps
return f(self, *args, **kwargs)
File "/home/superset/superset/views/core.py", line 1229, in explore_json
samples=samples,
File "/home/superset/superset/views/core.py", line 1160, in generate_json
payload = viz_obj.get_payload()
File "/home/superset/superset/viz.py", line 378, in get_payload
payload['data'] = self.get_data(df)
File "/home/superset/superset/viz.py", line 1231, in get_data
df = self.process_data(df)
File "/home/superset/superset/viz.py", line 1151, in process_data
values=self.metric_labels)
File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 5303, in pivot_table
margins_name=margins_name)
File "/usr/local/lib/python3.6/site-packages/pandas/core/reshape/pivot.py", line 61, in pivot_table
raise KeyError(i)
KeyError: 'my label'
Steps to reproduce
- Create a chart (I’ve reproduced this error with bar chart and line chart).
- Add a metric to the chart under
Query
>Metrics
in the chart UI. - Click on the created metric; this will open a new box, and at the top is a place to write a custom label for the metric. Provide the metric a non-uppercase label, e.g.
my label
. - Run the query.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Charts built off Snowflake only support uppercase metric labels
Chart fails to render when metric is given a non-uppercase label. Stacktrace is as follows: Traceback (most recent call last): File "/home/ ...
Read more >Using Worksheets for Queries / DML / DDL
Snowflake displays the worksheets that were open when you logged out. Note that resized/collapsed panes, width changes to the result/data preview columns, and ......
Read more >Snowflake Setup Guide - link - Fivetran
Connect data sources to Snowflake in minutes using Fivetran. Explore documentation and start syncing your applications, databases, events, files, and more.
Read more >Looker functions and operators | Google Cloud
These functions are supported only for table calculations (including table calculations used in the expression parameter of a data test). This page is...
Read more >All Functions (Alphabetical) - Tableau Help
An aggregate calculation that combines the values in the argument field. Null values are ignored. Note: The COLLECT function can only be used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yuyuhan0306 Try adding
{"connect_args": {"session_parameters": {"QUOTED_IDENTIFIERS_IGNORE_CASE": false}}}
to the engine_params of the Snowflake configuration. After that, you should be able to lowercase column names by running SELECT AS statements. I tested this out by runningSELECT hospital as "hospital" FROM emory.public.raw_er
, which returned a lowercase hospital column.@yuyuhan0306 Which branch are you on? If you are not on master, you will need this pull request: https://github.com/apache/incubator-superset/pull/7147