villebro commented on code in PR #21378:
URL: https://github.com/apache/superset/pull/21378#discussion_r971577301
##########
superset/common/query_context_processor.py:
##########
@@ -245,11 +246,20 @@ def normalize_df(self, df: pd.DataFrame, query_object:
QueryObject) -> pd.DataFr
if dttm_col:
timestamp_format = dttm_col.python_date_format
+ dttm_cols = tuple(
+ label
+ for label in get_base_axis_labels(query_object.columns)
+ if query_object.datasource
+ and (col := query_object.datasource.get_column(label))
+ and col.is_dttm
+ )
+
normalize_dttm_col(
df=df,
timestamp_format=timestamp_format,
offset=datasource.offset,
time_shift=query_object.time_shift,
+ dttm_cols=dttm_cols,
Review Comment:
As `timestamp_format` is defined per column, we would probably need to pass
a `dict` in that maps the respective column to its `timestamp_format`. So
instead of `dttm_cols` being `Optional[Tuple[str, ...]]`, maybe it should be a
`Optional[Dict[str, Optional[str]]]` where the key would be the respective
`timestamp_format` for said column?
--
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]