ktmud commented on a change in pull request #10637:
URL: https://github.com/apache/superset/pull/10637#discussion_r574388781
##########
File path: superset/viz.py
##########
@@ -840,8 +841,20 @@ def get_data(self, df: pd.DataFrame) -> VizData:
for metric in metrics:
aggfuncs[metric] = self.get_aggfunc(metric, df, self.form_data)
- groupby = self.form_data.get("groupby")
- columns = self.form_data.get("columns")
+ groupby = self.form_data.get("groupby") or []
+ columns = self.form_data.get("columns") or []
+
+ def _format_datetime(value: Any) -> Optional[str]:
+ if isinstance(value, str):
+ return f"__timestamp:{datetime_to_epoch(pd.Timestamp(value))}"
Review comment:
@villebro it seems this only supports unix timestamp data type, not
`datetime`. E.g. column generated from `SELECT now()` or `SELECT
date_trunc(TIMESTAMP '2020-01-01 00:00:00')` in PostgreSQL.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]