superset icon indicating copy to clipboard operation
superset copied to clipboard

SQL Lab + Postgres bug with quotes (psycopg2.ProgrammingError)

Open oxystin opened this issue 8 years ago • 4 comments

[Make]sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] 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.22.1

Expected results

Workable visualization

Actual results

  1. Simple Query
SELECT "SCHEDULED_ARRIVAL",
       "COUNTRY"
FROM public.flights
WHERE "DAY_OF_WEEK"='4'
screen shot 2017-12-15 at 05 09 57
  1. Click "Visualize"and get the error "psycopg2.ProgrammingError column "scheduled_arrival" does not exist"
screen shot 2017-12-15 at 05 10 59

SUM value without quotes is passed to the query:

screen shot 2017-12-15 at 05 34 17

Tell me how it can be quickly fixed? Thank you.

Steps to reproduce

oxystin avatar Dec 15 '17 02:12 oxystin

When it comes to fixing this issue, I'd like to remind that - if quotes were to be generally introduced for column names - we'll risk the same kind of regression that once was observed for quoted temporal column names: #3844

rumbin avatar Dec 16 '17 10:12 rumbin

As a quick workaround, it may work if you simply specify the capitalized column name in the Expression field of the column's definition.

rumbin avatar Dec 16 '17 10:12 rumbin

@rumbin Thanks for the answer. I'll try your recipe.

oxystin avatar Dec 18 '17 00:12 oxystin

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.

stale[bot] avatar Apr 11 '19 04:04 stale[bot]