kokhlo commented on code in PR #43960:
URL: https://github.com/apache/superset/pull/43960#discussion_r3966218168
##########
superset-frontend/packages/superset-ui-core/src/time-format/utils/normalizeTimestamp.ts:
##########
@@ -17,9 +17,21 @@
* under the License.
*/
+/**
+ * Timezone-aware strings carry an explicit UTC offset (`Z` or `±hh:mm`).
+ * Rewriting them to a bare `Z` would relabel the wall-clock time as UTC,
+ * shifting the instant; they are returned untouched. Timezone names
+ * (`UTC`, `Europe/Helsinki`) are not valid ISO offsets and are still
+ * stripped the historic way.
+ */
+const TS_REGEX_TZ_AWARE =
+ /^(\d{4}-\d{2}-\d{2})[T\s](\d{2}:\d{2}:\d{2}\.?\d*)(?:Z|[+-]\d{2}:?\d{2})$/;
Review Comment:
Good catch — fixed in 92259144a9. The tz-aware guard now accepts an optional
space before the offset, so the Trino form (`2023-03-11 08:26:52.695 +03:00`)
is returned untouched instead of falling through to `TS_REGEX`. Added the
regression case (both `+03:00` and `-05:00` variants) to the test file.
--
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]