bito-code-review[bot] commented on code in PR #38977:
URL: https://github.com/apache/superset/pull/38977#discussion_r3016479967
##########
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 -->
Understood—reverting to naive `datetime.now()` is the right call. Superset's
DB stores naive datetimes, so mixing with timezone-aware ones causes a
TypeError on subtraction. The original `AuditMixinNullable` uses naive
`datetime.now()` for the same reason, ensuring consistency.
--
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]