luth2 commented on code in PR #45823:
URL: https://github.com/apache/superset/pull/45823#discussion_r4431344228


##########
superset/utils/core.py:
##########
@@ -2131,13 +2131,24 @@ def _process_datetime_column(
 
         # Parse with or without format (suppress warning if no format)
         if format_to_use:
-            converted = pd.to_datetime(
-                df[col.col_label],
-                utc=False,
-                format=format_to_use,
-                errors="coerce",
-                exact=False,
-            )
+            try:
+                converted = pd.to_datetime(
+                    df[col.col_label],
+                    utc=False,
+                    format=format_to_use,
+                    errors="coerce",
+                    exact=False,
+                )
+            except ValueError as ex:
+                if "Mixed timezones" not in str(ex):
+                    raise
+                converted = pd.to_datetime(
+                    df[col.col_label],
+                    utc=True,

Review Comment:
   Confirmed: these joins intentionally compare local wall clocks, not UTC 
instants. Fixed in 6b78fdb989 by parsing formatted mixed-offset join values 
individually before the shared chart-normalization path can convert them to 
UTC. The chart path keeps its UTC behavior. A new regression compares mixed 
-05:00/-04:00 values with a single-offset series and requires local noon on 
both sides, with and without an explicit %z format; it also checks index/name 
preservation. The explicit-format case failed before the fix (17:00/16:00 
instead of 12:00) and now passes. All helpers and date-parsing tests pass on 
both Python 3.11/pandas 3.0.6 and Python 3.15/pandas 3.1.0.



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