ephraimbuddy commented on a change in pull request #20482:
URL: https://github.com/apache/airflow/pull/20482#discussion_r776641028
##########
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 tried adding an additional overload of `make_aware` but mypy errors
that it'll never be matched because of the arguments.
```
airflow/utils/timezone.py:113: error: Overloaded function signature 3 will
never be matched: signature 2's parameter type(s) are the same or broader
def make_aware(value: dt.datetime, timezone: Optional[dt.tzinfo] = N...
^
```
--
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]