question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Severe regression: Slices with calculated time(?) columns stopped working, due to quoting of the column expression

See original GitHub issue

Make 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:closed
  • Created 6 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rumbincommented, Nov 13, 2017

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.

0reactions
stale[bot]commented, Apr 11, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slices with calculated time(?) columns stopped working, due ...
Severe regression : Slices with calculated time(?) columns stopped working, due to quoting of the column expression #3844.
Read more >
DT expression not working - Activities - UiPath Forum
Expression assign activity. The rule i'm trying to have is DT.columns(“X”).Expression = “[Column A]+[Column B]”.
Read more >
Specify Computed Columns in a Table - SQL Server
A computed column expression can use data from other columns to calculate a value for the column to which it belongs.
Read more >
Formula Transformation: Create a Calculated Column Based ...
In Salesforce Data Pipelines, create a column in a Data Prep recipe that displays values based on a formula calculation. The calculation can...
Read more >
Hyperion System 9 BI+ Financial Reporting Studio Release ...
A vertical display of information in a grid. A column can contain text, data, or derived data from a calculation. You can format...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found