bito-code-review[bot] commented on code in PR #38977:
URL: https://github.com/apache/superset/pull/38977#discussion_r3016209677
##########
superset/mcp_service/dataset/schemas.py:
##########
@@ -307,6 +308,13 @@ def _parse_json_field(obj: Any, field_name: str) ->
Dict[str, Any] | None:
return value
+def _humanize_timestamp(dt: datetime | None) -> str | None:
+ """Convert a datetime to a humanized string like '2 hours ago'."""
+ if dt is None:
+ return None
+ return humanize.naturaltime(datetime.now() - dt)
Review Comment:
<!-- Bito Reply -->
Yes, the PR diff shows that all three `_humanize_timestamp` functions in
chart/schemas.py, dashboard/schemas.py, and dataset/schemas.py now use
`datetime.now(timezone.utc)` for consistent UTC handling.
--
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]