Severe regression: Slices with calculated time(?) columns stopped working, due to quoting of the column expression
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 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.20.5, regression from 0.20.4
Expected results
All slices can be loaded.
Actual results
Slices that contain calculated columns (defined via the Expression field of Add Column) fail to load. I observed this issue for a time column (Is temporal = [x]) and by have not checked if other calculated/virtual columns are affected, too. I can do that, if it would be helpful for debugging.
Steps to reproduce
I hope you don’t mind the German column names. If they distury you, I can translate them…
The calculated column auftrag_ende_projiziert
in my case is defined as
auftrag_ende + (date_trunc('year',current_date) - date_trunc('year', auftrag_ende))
In superset 0.20.4 the resulting query looks somewhat like this
SELECT to_char(auftrag_ende::date, 'IYYY') AS auftrag_ende_jahr,
DATE_TRUNC('week', auftrag_ende + (date_trunc('year',current_date) - date_trunc('year', auftrag_ende))) AS __timestamp,
sum(anzahl) AS sum__anzahl
FROM …
In superset 0.20.5 the expression of the calculated column now is quoted, which obviously causes the query to fail:
SELECT to_char(auftrag_ende::date, 'IYYY') AS auftrag_ende_jahr,
DATE_TRUNC('week', "auftrag_ende + (date_trunc('year',current_date) - date_trunc('year', auftrag_ende))") AS __timestamp,
sum(anzahl) AS sum__anzahl
FROM …
Unfortunately I don’t know which PR introduced the quoting, as I don’t know which PRs to take into account, as I suffer from the same ignorance as #3806…
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
I’d welcome if you reverted #3736, as ot breaks existing slices.
Users who suffer from #3208 may — until a permanent solution has been found — be advised to work around the issue by introducing a calculated temporal column with lowercased name, that simply contains the originally capitalized column name in (")-quotes as Expression.
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
.pinned
to prevent stale bot from closing the issue.