john-bodley commented on code in PR #24942:
URL: https://github.com/apache/superset/pull/24942#discussion_r1290426308
##########
superset/connectors/sqla/models.py:
##########
@@ -990,7 +990,9 @@ def adhoc_column_to_sqla( # pylint: disable=too-many-locals
time_grain = col.get("timeGrain")
has_timegrain = col.get("columnType") == "BASE_AXIS" and time_grain
is_dttm = False
+ pdf = None
if col_in_metadata := self.get_column(expression):
+ pdf = col_in_metadata.python_date_format
Review Comment:
Given that you're changing how the Python date format logic is used, would
you mind adding a unit test for this.
##########
superset/db_engine_specs/pinot.py:
##########
@@ -99,12 +101,13 @@ def get_timestamp_expr(
else:
seconds_or_ms = "MILLISECONDS" if pdf == "epoch_ms" else "SECONDS"
tf = f"1:{seconds_or_ms}:EPOCH"
+
if time_grain:
granularity = cls.get_time_grain_expressions().get(time_grain)
if not granularity:
raise NotImplementedError(f"No pinot grain spec for
'{time_grain}'")
else:
- return TimestampExpression("{{col}}", col)
+ return TimestampExpression("{col}", col)
Review Comment:
Would you also mind adding some unit tests for Pinot which cover the
`get_timestamp_expr` function. You can find many other examples of this in the
other DB engine specs.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]