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/06/16 08:11:00 UTC
[GitHub] [incubator-superset] villebro commented on a change in pull request
#7682: [PoC] SIP-15 Presto types
villebro commented on a change in pull request #7682: [PoC] SIP-15 Presto types
URL: https://github.com/apache/incubator-superset/pull/7682#discussion_r294072898
##########
File path: superset/connectors/sqla/models.py
##########
@@ -190,11 +190,21 @@ def dttm_sql_literal(self, dttm):
return str(seconds_since_epoch)
elif tf == 'epoch_ms':
return str(seconds_since_epoch * 1000)
- return "'{}'".format(dttm.strftime(tf))
+
+ # TODO(john-bodley): SIP-15 will only support ISO 8601 formats as this adheres
+ # to the lexigraphical ordering.
+ return f"'{dttm.strftime(tf)}'"
else:
s = self.table.database.db_engine_spec.convert_dttm(
self.type or '', dttm)
- return s or "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S.%f'))
+
+ if s:
+ return s
+
+ if app.config['SIP_15_ENABLED']:
+ raise TypeError(f"The '{type}' type is unsupported.")
Review comment:
shouldn't this be `{self.type}`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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