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 2022/09/16 06:57:08 UTC
[GitHub] [superset] villebro commented on a diff in pull request #21489: fix: BigQuery cannot accept Time Grain
villebro commented on code in PR #21489:
URL: https://github.com/apache/superset/pull/21489#discussion_r972675378
##########
superset/connectors/sqla/models.py:
##########
@@ -1144,9 +1144,10 @@ def adhoc_column_to_sqla(
and (time_grain := col.get("timeGrain"))
):
sqla_column = self.db_engine_spec.get_timestamp_expr(
- sqla_column,
- None,
- time_grain,
+ col=sqla_column,
+ pdf=None,
+ time_grain=time_grain,
+ type_=str(getattr(sqla_column, "type", "")),
Review Comment:
Could we refactor this so that `type_` is removed from the `BaseEngineSpec.get_timestamp_expr` sig and we then use `sqla_column.type` inside the method for `type_`? Or is the explicit `type_` needed somewhere else? I looked here, and I think we can infer the type from `ColumnClause.type` here, too.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org