You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/02/16 07:05:38 UTC

[GitHub] villebro opened a new pull request #6897: Force quotes on non-expression time grains on Postgres

villebro opened a new pull request #6897: Force quotes on non-expression time grains on Postgres
URL: https://github.com/apache/incubator-superset/pull/6897
 
 
   Due to time grains being rendered as literal columns in `sqla/models.py`, engine-specific quoting logic is not applied. This causes mixed-case columns to fail on Postgres in timeseries graphs if a time grain is applied. There have been attempts to fix this by forcing quotes in the time grain; however, this caused time grains on expressions to stop working (see #3844 for context). This PR introduces a function in `db_engine_specs.py` to handle rendering of the expression being passed to the time grain, which for Postgres forces quotes around the column name. This has been tested to work in all scenarios:
   - expression with time grain
   - expression without time grain
   - column with time grain
   - column without time grain
   
   Fixes #5886
   
   Before:
   <img width="1198" alt="screenshot 2019-02-16 at 8 48 41" src="https://user-images.githubusercontent.com/33317356/52895840-97b5b900-31c8-11e9-9e85-5ab28f6e3871.png">
   After:
   <img width="1199" alt="screenshot 2019-02-16 at 8 49 55" src="https://user-images.githubusercontent.com/33317356/52895836-87054300-31c8-11e9-9fa5-4e1977e4584b.png">
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org