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
Cannot display Time Series Line Chart #4770
Comments
Can you try on |
Hi, I have found the similar issue yesterday on 0.24.0. And it is not a problem only in Time Series Line Chart, I was able to reproduce it with Pie Chart and Histogram as well, I didn't try more visualizations. In my case, we use Snowflake database and I expected it is related to DB engine and I am still not sure what's exactly wrong, everything works fine with Superset examples and as well if I add the tables from Snowflake straight from dialog Sources/Tables/Add table (plus icon in right upper corner). But if I try to create datasource/table from query it didn't work. Then I realize there are quotes around column names in query (view query menu in graph view - upper right corner). Same as in @syzuhdi case
I tried to lowercase all column names and whoila, everything works. Lowercased name of columns are not in doublequotes and it is correctly interpreted. I made following steps:
It's not nice, but it works for us as a temporary workaround. |
Thank you @jhettler. It works for us. |
This may help these issues: |
I am also facing the same issue with Snowflake. I tracked it down to |
This bug is the same as #4662, where an alternative solution is outlined. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
@syzuhdi this issue has been resolved and can be closed |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
0.22.1
Expected results
Data shown in Time series Line Chart
Actual results
When I click Run Query button in Slices, an error occur.
Error u'CITY'
Traceback (most recent call last):
File "/usr/local/venv/lib/python2.7/site-packages/superset/viz.py", line 278, in get_payload
data = self.get_data(df)
File "/usr/local/venv/lib/python2.7/site-packages/superset/viz.py", line 1045, in get_data
df = self.process_data(df)
File "/usr/local/venv/lib/python2.7/site-packages/superset/viz.py", line 981, in process_data
values=fd.get('metrics'))
File "/usr/local/venv/lib/python2.7/site-packages/pandas/core/reshape/pivot.py", line 135, in pivot_table
grouped = data.groupby(keys)
File "/usr/local/venv/lib/python2.7/site-packages/pandas/core/generic.py", line 4416, in groupby
**kwargs)
File "/usr/local/venv/lib/python2.7/site-packages/pandas/core/groupby.py", line 1699, in groupby
return klass(obj, by, **kwds)
File "/usr/local/venv/lib/python2.7/site-packages/pandas/core/groupby.py", line 392, in init
mutated=self.mutated)
File "/usr/local/venv/lib/python2.7/site-packages/pandas/core/groupby.py", line 2690, in _get_grouper
raise KeyError(gpr)
KeyError: u'CITY'
And this is the QUERY
SELECT "CITY",
"timestamp",
"count_QTY"
FROM
(SELECT "CITY" AS "CITY",
"REGN_DATE" AS "timestamp",
count(VIN_NO) AS "count_QTY"
FROM
(SELECT *
FROM mycrm_registration) expr_qry
JOIN
(SELECT "CITY",
mme_inner
FROM
(SELECT "CITY" AS "CITY__",
count(VIN_NO) AS mme_inner__
FROM
(SELECT *
FROM mycrm_registration) expr_qry
WHERE "REGN_DATE" >= TO_TIMESTAMP('2018-03-30T00:00:00', 'YYYY-MM-DD"T"HH24:MI:SS.ff6')
AND "REGN_DATE" <= TO_TIMESTAMP('2018-04-06T08:20:13', 'YYYY-MM-DD"T"HH24:MI:SS.ff6')
GROUP BY "CITY"
ORDER BY count(VIN_NO) DESC)
WHERE ROWNUM <= 100) anon_1 ON "CITY" = "CITY__"
WHERE "REGN_DATE" >= TO_TIMESTAMP('2018-03-30T00:00:00', 'YYYY-MM-DD"T"HH24:MI:SS.ff6')
AND "REGN_DATE" <= TO_TIMESTAMP('2018-04-06T08:20:13', 'YYYY-MM-DD"T"HH24:MI:SS.ff6')
GROUP BY "CITY",
"REGN_DATE"
ORDER BY count(VIN_NO) DESC)
WHERE ROWNUM <= 50000
Any idea?
Steps to reproduce
The text was updated successfully, but these errors were encountered: