pierrejeambrun commented on code in PR #44124:
URL: https://github.com/apache/airflow/pull/44124#discussion_r1846090358
##########
airflow/api_fastapi/common/parameters.py:
##########
@@ -409,6 +409,27 @@ def _safe_parse_datetime(date_to_check: str) -> datetime:
"""
if not date_to_check:
raise ValueError(f"{date_to_check} cannot be None.")
+ return _safe_parse_datetime_optional(date_to_check)
+
+
+@overload
+def _safe_parse_datetime_optional(date_to_check: str) -> datetime: ...
+
+
+@overload
+def _safe_parse_datetime_optional(date_to_check: None) -> None: ...
+
+
+def _safe_parse_datetime_optional(date_to_check: str | None) -> datetime |
None:
+ """
+ Parse datetime and raise error for invalid dates.
+
+ Allow None values.
+
+ :param date_to_check: the string value to be parsed
+ """
+ if date_to_check is None:
+ return None
Review Comment:
Thanks for fixing
--
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]