potiuk commented on a change in pull request #20482:
URL: https://github.com/apache/airflow/pull/20482#discussion_r776309141
##########
File path: airflow/utils/timezone.py
##########
@@ -195,11 +201,11 @@ def coerce_datetime(v: None) -> None:
@overload
-def coerce_datetime(v: dt.datetime) -> DateTime:
+def coerce_datetime(v: dt.datetime) -> dt.datetime:
...
-def coerce_datetime(v: Optional[dt.datetime]) -> Optional[DateTime]:
+def coerce_datetime(v: Optional[dt.datetime]) -> Optional[dt.datetime]:
Review comment:
I think we need additional overload of `make_aware` with `DateTime` that
should fix it.
https://mypy.readthedocs.io/en/stable/more_types.html#function-overloading
--
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]