ashb commented on code in PR #76561:
URL: https://github.com/apache/airflow/pull/76561#discussion_r4503109609


##########
shared/timezones/src/airflow_shared/timezones/rfc3339.py:
##########
@@ -0,0 +1,58 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import re
+from datetime import date, datetime
+
+from pendulum.parsing import parse_iso8601
+
+_RFC3339_DATETIME = re.compile(
+    
r"\d{4}-(?:0[1-9]|1[0-2])-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?"
+    r"(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)",
+    re.ASCII,
+)

Review Comment:
   > Pendulum also rejects 2024-01-01t00:00:00z, but RFC 3339 allows a 
lowercase t and z.
   
   Right, let me fix that then :D (I'm a Pendulum maintainer)
   
   Pendulum's parser is generic, and I suspect all of those are iso8601 valid 
(` ` instead of `T` is I know that much) so if we want it to be just RFC3339 
then this is fine.
   
   Note however that this accepts `2026-02-31T...` and other such "invalid" 
dates.  



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

Reply via email to