bito-code-review[bot] commented on code in PR #38977:
URL: https://github.com/apache/superset/pull/38977#discussion_r3016472924


##########
superset/mcp_service/chart/schemas.py:
##########
@@ -271,6 +272,13 @@ def validate_identifier_or_form_data_key(self) -> 
"GetChartInfoRequest":
         return self
 
 
+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 -->
   The reversion to naive `datetime.now()` is correct here. Superset DB stores 
naive timestamps, so subtracting a timezone-aware `datetime.now(timezone.utc)` 
from a naive `dt` would raise a TypeError at runtime due to incompatible types. 
Using naive datetimes ensures consistency and avoids the error you caught in 
staging.



-- 
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]

Reply via email to