[GitHub] betodealmeida commented on a change in pull request #4890: [bugfix] temporal columns with expression fail

2018-04-26 Thread GitBox
betodealmeida commented on a change in pull request #4890: [bugfix] temporal 
columns with expression fail
URL: 
https://github.com/apache/incubator-superset/pull/4890#discussion_r184555680
 
 

 ##
 File path: superset/connectors/sqla/models.py
 ##
 @@ -130,8 +131,9 @@ def get_timestamp_expression(self, time_grain):
 elif pdf == 'epoch_ms':
 expr = db_spec.epoch_ms_to_dttm().format(col=expr)
 grain = self.table.database.grains_dict().get(time_grain)
-literal = grain.function if grain else '{col}'
-literal = expr.format(col=expr)
+if grain:
+literal = grain.function
+literal = expr.format(col=expr)
 
 Review comment:
   Yeah, I think this should be
   
   ```python
   literal = literal.format(col=expr)
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] betodealmeida commented on a change in pull request #4890: [bugfix] temporal columns with expression fail

2018-04-26 Thread GitBox
betodealmeida commented on a change in pull request #4890: [bugfix] temporal 
columns with expression fail
URL: 
https://github.com/apache/incubator-superset/pull/4890#discussion_r184555737
 
 

 ##
 File path: superset/connectors/sqla/models.py
 ##
 @@ -130,8 +131,9 @@ def get_timestamp_expression(self, time_grain):
 elif pdf == 'epoch_ms':
 expr = db_spec.epoch_ms_to_dttm().format(col=expr)
 grain = self.table.database.grains_dict().get(time_grain)
-literal = grain.function if grain else '{col}'
-literal = expr.format(col=expr)
+if grain:
+literal = grain.function
+literal = expr.format(col=expr)
 
 Review comment:
   See https://github.com/apache/incubator-superset/pull/4892


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:
us...@infra.apache.org


With regards,
Apache Git Services