-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Force quotes on non-expression time grains on Postgres #6897
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6897 +/- ##
==========================================
+ Coverage 63.96% 63.97% +0.01%
==========================================
Files 422 422
Lines 20524 20533 +9
Branches 2230 2230
==========================================
+ Hits 13128 13137 +9
Misses 7264 7264
Partials 132 132
Continue to review full report at Codecov.
|
Unit tests please! |
Added test cases for expression, lower_case and MixedCase column names that mimic what's going on in |
@villebro, thanks a lot for sorting this quoting issue out comprehensively |
FYI @mistercrunch rebased to resolve conflicts |
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 indb_engine_specs.py
to handle rendering of the expression being passed to the time grain, which for Postgres forces quotes around MixedCase column names, but not lower_case. This has been tested to work in all scenarios:Fixes #5886
Before:
After: