You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2017/10/31 04:02:50 UTC

[GitHub] mistercrunch closed pull request #3736: [Bugfix] Escape columns names for time grains - postgres

mistercrunch closed pull request #3736: [Bugfix] Escape columns names for time grains - postgres
URL: https://github.com/apache/incubator-superset/pull/3736
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index c9ed303473..c5363af2b2 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -214,14 +214,14 @@ class PostgresEngineSpec(BaseEngineSpec):
 
     time_grains = (
         Grain("Time Column", _('Time Column'), "{col}"),
-        Grain("second", _('second'), "DATE_TRUNC('second', {col})"),
-        Grain("minute", _('minute'), "DATE_TRUNC('minute', {col})"),
-        Grain("hour", _('hour'), "DATE_TRUNC('hour', {col})"),
-        Grain("day", _('day'), "DATE_TRUNC('day', {col})"),
-        Grain("week", _('week'), "DATE_TRUNC('week', {col})"),
-        Grain("month", _('month'), "DATE_TRUNC('month', {col})"),
-        Grain("quarter", _('quarter'), "DATE_TRUNC('quarter', {col})"),
-        Grain("year", _('year'), "DATE_TRUNC('year', {col})"),
+        Grain("second", _('second'), "DATE_TRUNC('second', \"{col}\")"),
+        Grain("minute", _('minute'), "DATE_TRUNC('minute', \"{col}\")"),
+        Grain("hour", _('hour'), "DATE_TRUNC('hour', \"{col}\")"),
+        Grain("day", _('day'), "DATE_TRUNC('day', \"{col}\")"),
+        Grain("week", _('week'), "DATE_TRUNC('week', \"{col}\")"),
+        Grain("month", _('month'), "DATE_TRUNC('month', \"{col}\")"),
+        Grain("quarter", _('quarter'), "DATE_TRUNC('quarter', \"{col}\")"),
+        Grain("year", _('year'), "DATE_TRUNC('year', \"{col}\")"),
     )
 
     @classmethod


 

----------------------------------------------------------------
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