typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Make datetime generic over tzinfo

Open srittau opened this issue 1 year ago • 15 comments

srittau avatar Apr 29 '24 11:04 srittau

This is a trial to judge the impact of such a change that could prevent runtime errors due to mixing timezone-aware and unaware datetimes.

srittau avatar Apr 29 '24 11:04 srittau

Diff from mypy_primer, showing the effect of this PR on open source code:

python-sop (https://gitlab.com/dkg/python-sop)
+ sop/__init__.py:186: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None]")  [assignment]
+ sop/__init__.py:424: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]
+ sop/__init__.py:425: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]

pip (https://github.com/pypa/pip)
+ src/pip/_internal/self_outdated_check.py:238: error: Argument "current_time" to "_self_version_check_logic" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]

itsdangerous (https://github.com/pallets/itsdangerous)
+ src/itsdangerous/timed.py:43: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[Optional[tzinfo]]")  [return-value]

pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/v1/datetime_parse.py:86: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/utils.py:356: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ steam/utils.py:361: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ steam/utils.py:368: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ steam/http.py:699: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo | None]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for > ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[tzinfo | None] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for < ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[tzinfo | None] | None"
+ steam/abc.py:1002: error: Argument "before" to "history" of "Messageable" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ steam/abc.py:1003: error: Argument "after" to "history" of "Messageable" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ steam/abc.py:1120: error: Unsupported operand types for - ("datetime[tzinfo | None]" and "datetime[tzinfo]")  [operator]
+ steam/client.py:1214: error: Argument 4 to "fetch_user_news" of "ConnectionState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]

mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/__init__.py:71: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ mkdocs/utils/__init__.py:73: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]

paasta (https://github.com/yelp/paasta)
+ paasta_tools/utils.py:3715: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo]")  [return-value]
+ paasta_tools/utils.py:3720: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ paasta_tools/utils.py:3727: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/utils.py:3735: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/tron_tools.py:203: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ paasta_tools/cli/cmds/validate.py:470: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/validate.py:470: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/validate.py:470: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/validate.py:753: error: Argument 1 to "get_next" of "croniter" has incompatible type "Type[datetime[Any]]"; expected "Optional[Union[Type[float], Type[datetime[tzinfo]]]]"  [arg-type]
+ paasta_tools/cli/cmds/logs.py:1241: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]
+ paasta_tools/cli/cmds/logs.py:1241: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/logs.py:1242: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]
+ paasta_tools/cli/cmds/logs.py:1242: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/logs.py:1244: error: Unsupported operand types for > ("datetime[None]" and "datetime[None]")  [operator]
+ paasta_tools/cli/cmds/logs.py:1247: error: Incompatible return value type (got "Tuple[datetime[None], datetime[None]]", expected "Tuple[datetime[tzinfo], datetime[tzinfo]]")  [return-value]
+ paasta_tools/cli/cmds/get_image_version.py:144: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]

manticore (https://github.com/trailofbits/manticore)
+ manticore/core/plugin.py:432: error: Argument "default_factory" to "field" has incompatible type overloaded function; expected "Callable[[], datetime[tzinfo | None]]"  [arg-type]
+ manticore/core/plugin.py:436: error: Argument "default_factory" to "field" has incompatible type overloaded function; expected "Callable[[], datetime[tzinfo | None]]"  [arg-type]
+ manticore/core/worker.py:376: error: Unsupported operand types for - ("datetime[None]" and "datetime[tzinfo | None]")  [operator]
+ manticore/core/worker.py:376: note: Right operand is of type "datetime[tzinfo | None] | datetime[None]"

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:88: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, ts: float, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:90: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:100: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:102: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas/core/arrays/datetimelike.py:1438: error: Argument 1 to "_sub_datetimelike_scalar" of "DatetimeLikeArrayMixin" has incompatible type "datetime[None] | datetime64"; expected "datetime[tzinfo | None] | datetime64"  [arg-type]
+ pandas/io/stata.py:411: error: Unsupported operand types for - ("datetime[tzinfo | None]" and "datetime[None]")  [operator]
+ pandas/io/stata.py:2809: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ pandas/io/stata.py:2830: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/io/stata.py:2831: error: "None" has no attribute "month"  [attr-defined]
+ pandas/io/stata.py:2832: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/io/stata.py:3344: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ pandas/io/stata.py:3364: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/io/stata.py:3365: error: "None" has no attribute "month"  [attr-defined]
+ pandas/io/stata.py:3366: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/core/indexes/period.py:474: error: Argument 1 to "_cast_partial_indexing_scalar" of "PeriodIndex" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/core/indexes/period.py:500: error: Argument 1 to "_cast_partial_indexing_scalar" of "PeriodIndex" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/io/sas/sas_xport.py:151: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | NaTType")  [return-value]
+ pandas/tests/tseries/offsets/test_business_day.py:145: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:146: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:147: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:148: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:149: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:155: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:156: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:157: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:158: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:159: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:165: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:166: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:167: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:168: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:169: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:170: error: Dict entry 5 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:176: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:177: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:178: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:179: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:180: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:181: error: Dict entry 5 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:182: error: Dict entry 6 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:188: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:189: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:190: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:191: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:192: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/scalar/test_nat.py:364: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/tests/scalar/test_nat.py:364: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/tests/scalar/test_nat.py:364: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/tests/resample/test_datetime_index.py:1314: error: List item 0 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1315: error: List item 1 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1316: error: List item 2 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1317: error: List item 3 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1318: error: List item 4 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1319: error: List item 5 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/catalog/test_utils.py: note: In function "test_published_in_future_year":
+ openlibrary/tests/catalog/test_utils.py:239: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ openlibrary/core/db.py:180: error: Argument 2 to "register_adapter" has incompatible type "Callable[[datetime[tzinfo | None]], str]"; expected "Callable[[datetime[None]], str | Buffer | int | float | None]"  [arg-type]
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/core/models.py: note: In member "resolve_redirects_bulk" of class "Work":
+ openlibrary/core/models.py:730: error: Incompatible default for argument "cutoff_date" (default has type "datetime[None]", argument has type "datetime[tzinfo | None]")  [assignment]
+ openlibrary/core/models.py:743: error: Incompatible types in assignment (expression has type "object", variable has type "datetime[tzinfo | None]")  [assignment]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/i18n.py: note: In function "format_date":
+ sphinx/util/i18n.py:228:20: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Optional[datetime[Optional[tzinfo]]]")  [assignment]
+ sphinx/util/i18n.py:230:20: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Optional[datetime[Optional[tzinfo]]]")  [assignment]
+ sphinx/util/i18n.py:249:45: error: Argument 1 to "babel_format_date" has incompatible type "Optional[datetime[Optional[tzinfo]]]"; expected "datetime[Optional[tzinfo]]"  [arg-type]

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/helpers.py:1079:24: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ aiohttp/web_response.py:262:46: error: Never has no attribute "utctimetuple"  [attr-defined]

rich (https://github.com/Textualize/rich)
+ rich/console.py:1969: error: Argument "log_time" to "__call__" of "LogRender" has incompatible type "datetime[tzinfo | None] | datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ rich/_log_render.py:57: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None] | datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ rich/_log_render.py:60: error: Argument 1 has incompatible type "datetime[tzinfo | None] | None"; expected "datetime[tzinfo | None]"  [arg-type]
+ rich/_log_render.py:62: error: Item "None" of "datetime[tzinfo | None] | None" has no attribute "strftime"  [union-attr]
+ rich/logging.py:224: error: Argument "log_time" to "__call__" of "LogRender" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]

optuna (https://github.com/optuna/optuna)
+ optuna/trial/_frozen.py:572: error: Incompatible types in assignment (expression has type "datetime[None] | None", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/trial/_frozen.py:582: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/trial/_fixed.py:179: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]
+ optuna/storages/_in_memory.py:168: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/storages/_in_memory.py:263: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/storages/_in_memory.py:266: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/study/_optimize.py:112: error: Argument 10 to "submit" of "Executor" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/study/_optimize.py:142: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/study/_optimize.py:154: error: Unsupported operand types for - ("datetime[None]" and "datetime[tzinfo | None]")  [operator]
+ optuna/study/_optimize.py:154: error: No overload variant of "__sub__" of "datetime" matches argument type "None"  [operator]
+ optuna/study/_optimize.py:154: note: Possible overload variants:
+ optuna/study/_optimize.py:154: note:     def __sub__(self, datetime[None], /) -> timedelta
+ optuna/study/_optimize.py:154: note:     def __sub__(self, timedelta, /) -> datetime[None]
+ optuna/study/_optimize.py:154: note: Right operand is of type "datetime[tzinfo | None] | None"
+ optuna/study/_optimize.py:173: error: Unsupported operand types for - ("datetime[None]" and "datetime[tzinfo | None]")  [operator]
+ optuna/study/_optimize.py:173: error: No overload variant of "__sub__" of "datetime" matches argument type "None"  [operator]
+ optuna/study/_optimize.py:173: note: Possible overload variants:
+ optuna/study/_optimize.py:173: note:     def __sub__(self, datetime[None], /) -> timedelta
+ optuna/study/_optimize.py:173: note:     def __sub__(self, timedelta, /) -> datetime[None]
+ optuna/study/_optimize.py:173: note: Right operand is of type "datetime[tzinfo | None] | None"
+ tests/trial_tests/test_frozen.py:285: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/trial_tests/test_frozen.py:286: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/trial_tests/test_frozen.py:430: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/trial_tests/test_frozen.py:431: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/storages_tests/test_storages.py:301: error: Argument 4 to "_check_trials" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ tests/storages_tests/test_storages.py:301: error: Argument 5 to "_check_trials" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ tests/storages_tests/test_storages.py:1045: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/storages_tests/test_storages.py:1046: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/visualization/_timeline.py:90: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ optuna/visualization/_timeline.py:94: error: Argument "default" to "max" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ optuna/visualization/_timeline.py:107: error: Unsupported operand types for - ("datetime[None]" and "datetime[tzinfo | None]")  [operator]
+ tests/visualization_tests/test_utils.py:186: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:187: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:218: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:219: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:254: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:255: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_timeline.py:66: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_timeline.py:67: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_timeline.py:103: error: Unsupported left operand type for <= (Never)  [operator]
+ tests/visualization_tests/test_timeline.py:126: error: Unsupported left operand type for < (Never)  [operator]

pytest (https://github.com/pytest-dev/pytest)
+ testing/test_junitxml.py:227: error: Unsupported operand types for <= ("datetime[None]" and "datetime[None]")  [operator]
+ testing/test_junitxml.py:227: error: Unsupported operand types for < ("datetime[None]" and "datetime[None]")  [operator]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/options.py:633: error: Incompatible return value type (got "datetime[None]", expected "datetime[Optional[tzinfo]]")  [return-value]
+ tornado/locale.py:352: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[int, float, datetime[Optional[tzinfo]]]")  [assignment]
+ tornado/locale.py:353: error: Item "int" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "tzinfo"  [union-attr]
+ tornado/locale.py:353: error: Item "float" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "tzinfo"  [union-attr]
+ tornado/locale.py:354: error: Item "int" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "replace"  [union-attr]
+ tornado/locale.py:354: error: Item "float" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "replace"  [union-attr]
+ tornado/locale.py:354: error: Incompatible types in assignment (expression has type "Union[Any, datetime[tzinfo]]", variable has type "Union[int, float, datetime[Optional[tzinfo]]]")  [assignment]
+ tornado/locale.py:356: error: Unsupported operand types for > ("int" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:356: error: Unsupported operand types for > ("float" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:356: note: Left operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/locale.py:357: error: Item "int" of "Union[int, float, timedelta]" has no attribute "seconds"  [union-attr]
+ tornado/locale.py:357: error: Item "float" of "Union[int, float, timedelta]" has no attribute "seconds"  [union-attr]
+ tornado/locale.py:357: error: Unsupported operand types for - ("int" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:357: error: Unsupported operand types for - ("float" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:357: error: Unsupported operand types for - ("datetime[Optional[tzinfo]]" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:357: note: Left operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/locale.py:361: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[int, float, datetime[Optional[tzinfo]]]")  [assignment]
+ tornado/locale.py:365: error: Unsupported operand types for - ("int" and "timedelta")  [operator]
+ tornado/locale.py:365: error: Unsupported operand types for - ("float" and "timedelta")  [operator]
+ tornado/locale.py:365: note: Left operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/locale.py:368: error: No overload variant of "__sub__" of "datetime" matches argument type "int"  [operator]
+ tornado/locale.py:368: note: Possible overload variants:
+ tornado/locale.py:368: note:     def __sub__(self, datetime[tzinfo], /) -> timedelta
+ tornado/locale.py:368: note:     def __sub__(self, timedelta, /) -> datetime[tzinfo]
+ tornado/locale.py:368: error: No overload variant of "__sub__" of "datetime" matches argument type "float"  [operator]
+ tornado/locale.py:368: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[Optional[tzinfo]]")  [operator]
+ tornado/locale.py:368: note: Right operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/httputil.py:870: error: Never has no attribute "utctimetuple"  [attr-defined]
+ tornado/web.py:650: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[float, Tuple[Any, ...], datetime[Optional[tzinfo]], None]")  [assignment]
+ tornado/web.py:706: error: Argument "expires" to "set_cookie" of "RequestHandler" has incompatible type "datetime[tzinfo]"; expected "Union[float, Tuple[Any, ...], datetime[Optional[tzinfo]], None]"  [arg-type]
+ tornado/web.py:2800: error: Argument 2 to "set_header" of "RequestHandler" has incompatible type "datetime[tzinfo]"; expected "Union[bytes, str, int, Integral, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/web.py:2800: note: Types from "numbers" aren't supported for static type checking
+ tornado/web.py:2800: note: See https://peps.python.org/pep-0484/#the-numeric-tower
+ tornado/web.py:2800: note: Consider using a protocol instead, such as typing.SupportsFloat
+ tornado/web.py:2822: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ tornado/web.py:3006: error: Incompatible return value type (got "datetime[tzinfo]", expected "Optional[datetime[Optional[tzinfo]]]")  [return-value]
+ tornado/test/locale_test.py:91: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:100: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:100: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:106: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:106: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:112: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:112: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:119: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:119: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:126: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:128: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:132: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:134: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:138: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:140: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:158: error: Argument "date" to "format_day" of "Locale" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tornado/test/locale_test.py:159: error: Argument "date" to "format_day" of "Locale" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tornado/test/web_test.py:411: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[Optional[tzinfo]]")  [operator]
+ tornado/test/web_test.py:1748: error: Unsupported operand types for - ("datetime[Optional[tzinfo]]" and "datetime[tzinfo]")  [operator]
+ tornado/test/web_test.py:3063: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ tornado/test/web_test.py:3064: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[Optional[tzinfo]]")  [operator]
+ tornado/test/httpclient_test.py:891: error: Argument "if_modified_since" to "HTTPRequest" has incompatible type "datetime[tzinfo]"; expected "Union[float, datetime[Optional[tzinfo]], None]"  [arg-type]
+ tornado/test/httpclient_test.py:893: error: Argument 1 to "format_timestamp" has incompatible type "datetime[tzinfo]"; expected "Union[int, float, Tuple[Any, ...], struct_time, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/httpclient_test.py:899: error: Argument "if_modified_since" to "HTTPRequest" has incompatible type "datetime[None]"; expected "Union[float, datetime[Optional[tzinfo]], None]"  [arg-type]
+ tornado/test/httpclient_test.py:901: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "Union[int, float, Tuple[Any, ...], struct_time, datetime[Optional[tzinfo]]]"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/dbapi20.py:113: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/dbapi20.py:122: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/dbapi20.py:122: note: Perhaps you need a type annotation for "rv"? Suggestion: "datetime[tzinfo | None]"
+ psycopg/psycopg/types/datetime.py:170: error: Unsupported operand types for - ("datetime[tzinfo | None]" and "datetime[tzinfo]")  [operator]
+ psycopg/psycopg/types/datetime.py:186: error: Unsupported operand types for - ("datetime[tzinfo | None]" and "datetime[None]")  [operator]
+ psycopg/psycopg/types/datetime.py:464: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:475: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:542: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:548: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:576: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ psycopg/psycopg/types/datetime.py:593: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]
+ tests/test_connection_info.py:173: error: Argument 1 to "utcoffset" of "tzinfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/test_connection_info.py:175: error: Argument 1 to "utcoffset" of "tzinfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]

boostedblob (https://github.com/hauntsaninja/boostedblob)
+ boostedblob/google_auth.py:253: error: Incompatible return value type (got "Tuple[str, datetime[None]]", expected "Tuple[str, datetime[Optional[tzinfo]]]")  [return-value]
+ boostedblob/azure_auth.py:638: error: Incompatible return value type (got "Tuple[str, datetime[None]]", expected "Tuple[str, datetime[Optional[tzinfo]]]")  [return-value]
+ boostedblob/_recover.py:226: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[str, datetime[Optional[tzinfo]]]")  [assignment]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/_internal.py:113: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/_internal.py:115: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/http.py:983: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/http.py:1010: error: Argument 1 to "_dt_as_utc" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/werkzeug/http.py:1012: error: Argument 1 to "format_datetime" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/werkzeug/sansio/response.py:445: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/middleware/shared_data.py:150: error: Incompatible return value type (got "Callable[[], tuple[BufferedReader, datetime[tzinfo], int]]", expected "Callable[[], tuple[IO[bytes], datetime[tzinfo | None], int]]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:150: error: Incompatible return value type (got "tuple[BufferedReader, datetime[tzinfo], int]", expected "tuple[IO[bytes], datetime[tzinfo | None], int]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:183: error: Incompatible return value type (got "tuple[str, Callable[[], tuple[BytesIO, datetime[tzinfo], int]]]", expected "tuple[str | None, Callable[[], tuple[IO[bytes], datetime[tzinfo | None], int]] | None]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:185: error: Incompatible return value type (got "tuple[BytesIO, datetime[tzinfo], int]", expected "tuple[IO[bytes], datetime[tzinfo | None], int]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:188: error: Incompatible return value type (got "tuple[str, Callable[[], tuple[Any, datetime[tzinfo], int]]]", expected "tuple[str | None, Callable[[], tuple[IO[bytes], datetime[tzinfo | None], int]] | None]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:190: error: Incompatible return value type (got "tuple[Any, datetime[tzinfo], int]", expected "tuple[IO[bytes], datetime[tzinfo | None], int]")  [return-value]
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ tests/test_send_file.py:39: error: Argument "last_modified" to "send_file" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | int | float | None"  [arg-type]
+ tests/test_send_file.py:133: error: Argument "last_modified" to "send_file" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | int | float | None"  [arg-type]
+ tests/test_http.py:422: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:425: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:438: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:451: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:454: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:457: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]

PyGithub (https://github.com/PyGithub/PyGithub)
+ github/GithubObject.py:87: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ github/GithubObject.py:276: error: Argument 3 to "__makeTransformedAttribute" of "GithubObject" has incompatible type "Callable[[int], datetime[tzinfo]]"; expected "Callable[[int], datetime[tzinfo | None]]"  [arg-type]
+ github/GithubObject.py:276: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ github/AccessToken.py:145: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None]")  [assignment]
+ github/Issue.py:408: error: Never has no attribute "strftime"  [attr-defined]
+ github/AuthenticatedUser.py:958: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ github/AuthenticatedUser.py:960: error: Never has no attribute "strftime"  [attr-defined]
+ github/Repository.py:3553: error: Incompatible default for argument "last_read_at" (default has type "datetime[tzinfo]", argument has type "datetime[tzinfo | None]")  [assignment]
+ github/Repository.py:3559: error: Never has no attribute "strftime"  [attr-defined]

starlette (https://github.com/encode/starlette)
+ tests/test_convertors.py:27: error: Incompatible return value type (got "datetime[None]", expected "datetime[Optional[tzinfo]]")  [return-value]

kopf (https://github.com/nolar/kopf)
+ kopf/_cogs/structs/credentials.py:241: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ kopf/_cogs/structs/credentials.py:329: error: Unsupported operand types for >= ("datetime[tzinfo]" and "datetime[tzinfo]")  [operator]
+ kopf/_cogs/structs/credentials.py:329: note: Right operand is of type "datetime[tzinfo] | datetime[tzinfo | None]"
+ kopf/_cogs/structs/credentials.py:395: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "object"  [type-var]
+ kopf/_cogs/structs/credentials.py:395: error: Incompatible types in assignment (expression has type "object", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ kopf/_core/actions/execution.py:126: error: No overload variant of "__sub__" of "datetime" matches argument type "object"  [operator]
+ kopf/_core/actions/execution.py:126: note: Possible overload variants:
+ kopf/_core/actions/execution.py:126: note:     def __sub__(self, datetime[tzinfo], /) -> timedelta
+ kopf/_core/actions/execution.py:126: note:     def __sub__(self, timedelta, /) -> datetime[tzinfo]
+ kopf/_core/actions/execution.py:280: error: Argument "started" to "invoke_handler" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ kopf/_core/actions/progression.py:59: error: Argument "started" to "HandlerState" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:67: error: Argument "started" to "HandlerState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:114: error: Argument "started" to "HandlerState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:115: error: Argument "stopped" to "HandlerState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:116: error: Argument "delayed" to "HandlerState" has incompatible type "datetime[tzinfo] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:320: error: Unsupported operand types for - ("datetime[tzinfo | None]" and "datetime[tzinfo]")  [operator]
+ kopf/_core/engines/probing.py:52: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[tzinfo | None]")  [operator]
+ kopf/_core/engines/probing.py:55: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[tzinfo | None]")  [operator]
+ kopf/_core/engines/probing.py:67: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]

dragonchain (https://github.com/dragonchain/dragonchain)
+ dragonchain/lib/authorization.py:51:12: error: Incompatible return value type (got "datetime[None]", expected "datetime[Optional[tzinfo]]")  [return-value]

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ scheduler/time_utils.py:42: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/time_utils.py:42: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/time_utils.py:42: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/time_utils.py:54: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ embedmaker/time_utils.py:42: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ embedmaker/time_utils.py:42: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ embedmaker/time_utils.py:42: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ embedmaker/time_utils.py:54: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ scheduler/converters.py:96: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ scheduler/converters.py:144: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ guildjoinrestrict/core.py:322: error: Argument 3 to "EventQueueItem" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/tasks.py:41: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ scheduler/tasks.py:89: error: Argument "initial" to "Task" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/tasks.py:104: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[Optional[tzinfo]]")  [operator]
+ scheduler/tasks.py:106: error: Unsupported operand types for - ("datetime[Optional[tzinfo]]" and "datetime[tzinfo]")  [operator]
+ scheduler/scheduler.py:767: error: Argument "initial" to "Task" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/scheduler.py:830: error: Argument "initial" to "Task" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]

spark (https://github.com/apache/spark)
+ python/pyspark/sql/variant_utils.py:221: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/variant_utils.py:226: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/types.py:379: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/types.py:400: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/connect/expressions.py:259: error: Argument 1 to "toInternal" of "TimestampType" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ python/pyspark/sql/connect/expressions.py:262: error: Argument 1 to "toInternal" of "TimestampNTZType" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/streaming/dstream.py:581: error: Never has no attribute "timetuple"  [attr-defined]

operator (https://github.com/canonical/operator)
+ ops/_private/timeconv.py:62: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ ops/model.py:483: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]
+ ops/model.py:2540: error: Argument "last_modified" to "FileInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:2695: error: Argument "rotates" to "SecretInfo" has incompatible type "datetime[None] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ ops/testing.py:3482: error: Argument "first_occurred" to "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:3483: error: Argument "last_occurred" to "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:3484: error: Argument "last_repeated" to "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:3497: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None]")  [assignment]
+ ops/testing.py:3501: error: Argument "last_occurred" to "replace" of "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/conversion.py:1409: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[Optional[tzinfo]]")  [return-value]
+ tanjun/conversion.py:1456: error: Argument 1 to "from_datetime" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tanjun/context/slash.py:471: error: Unsupported operand types for - ("datetime[tzinfo]" and "datetime[Optional[tzinfo]]")  [operator]
+ tanjun/schedules.py:1005: error: Argument "current_date" to "_TimeScheduleConfig" has incompatible type "Union[datetime[tzinfo], datetime[None]]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tanjun/schedules.py:1044: error: Incompatible types in assignment (expression has type "Union[datetime[tzinfo], datetime[None]]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ tanjun/schedules.py:1076: error: Argument 2 to "_Datetime" has incompatible type "Union[datetime[tzinfo], datetime[None]]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tanjun/schedules.py:1077: error: Unsupported operand types for - ("datetime[Optional[tzinfo]]" and "datetime[tzinfo]")  [operator]
+ tanjun/schedules.py:1077: error: Unsupported operand types for - ("datetime[Optional[tzinfo]]" and "datetime[None]")  [operator]
+ tanjun/schedules.py:1077: note: Right operand is of type "Union[datetime[tzinfo], datetime[None]]"
+ tanjun/dependencies/limiters.py:499: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[Optional[tzinfo]]")  [return-value]

bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch_storage_plugins/swift.py: note: In member "get_upload_time" of class "SwiftStorage":
+ src/bandersnatch_storage_plugins/swift.py:989: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ src/bandersnatch_storage_plugins/s3.py: note: In member "get_upload_time" of class "S3Storage":
+ src/bandersnatch_storage_plugins/s3.py:430: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ src/bandersnatch_storage_plugins/filesystem.py: note: In member "get_upload_time" of class "FilesystemStorage":
+ src/bandersnatch_storage_plugins/filesystem.py:286: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ src/bandersnatch/tests/plugins/test_storage_plugins.py: note: In function "get_swift_file_attrs":
+ src/bandersnatch/tests/plugins/test_storage_plugins.py:44: error: Argument 1 to "get_swift_date" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/bandersnatch/tests/plugins/test_storage_plugins.py: note: In member "head_object" of class "MockConnection":
+ src/bandersnatch/tests/plugins/test_storage_plugins.py:188: error: Argument 1 to "get_swift_object_date" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/bandersnatch/tests/plugins/test_storage_plugin_s3.py: note: In function "test_upload_time":
+ src/bandersnatch/tests/plugins/test_storage_plugin_s3.py:251: error: Argument 2 to "set_upload_time" of "S3Storage" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]

mkosi (https://github.com/systemd/mkosi)
+ mkosi/manifest.py:90:88: error: Argument "default_factory" to "field" has incompatible type overloaded function; expected "Callable[[], datetime[Optional[tzinfo]]]"  [arg-type]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, t: float, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:115: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:129: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:159: error: Return type "Timestamp" of "astimezone" incompatible with return type "datetime[tzinfo]" in supertype "datetime"  [override]
+ tests/test_timefuncs.py:79: error: Unsupported operand types for - ("Timestamp" and "datetime[None]")  [operator]
+ tests/test_timefuncs.py:167: error: Unsupported operand types for - ("TimestampSeries" and "datetime[None]")  [operator]
+ tests/test_scalars.py:539: error: Expression is of type "date", not "Timestamp"  [assert-type]
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]
+ tests/test_scalars.py:1334: error: Expression is of type "Literal[False]", not "bool"  [as

... (truncated 234 lines) ...

github-actions[bot] avatar Apr 29 '24 12:04 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

python-sop (https://gitlab.com/dkg/python-sop)
+ sop/__init__.py:186: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None]")  [assignment]
+ sop/__init__.py:424: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]
+ sop/__init__.py:425: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]

pip (https://github.com/pypa/pip)
+ src/pip/_internal/self_outdated_check.py:238: error: Argument "current_time" to "_self_version_check_logic" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]

itsdangerous (https://github.com/pallets/itsdangerous)
+ src/itsdangerous/timed.py:43: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[Optional[tzinfo]]")  [return-value]

pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/v1/datetime_parse.py:86: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/utils.py:356: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ steam/utils.py:361: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ steam/utils.py:368: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ steam/http.py:699: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo | None]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for > ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[tzinfo | None] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for < ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[tzinfo | None] | None"
+ steam/abc.py:1002: error: Argument "before" to "history" of "Messageable" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ steam/abc.py:1003: error: Argument "after" to "history" of "Messageable" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ steam/client.py:1214: error: Argument 4 to "fetch_user_news" of "ConnectionState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]

mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/__init__.py:71: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ mkdocs/utils/__init__.py:73: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]

paasta (https://github.com/yelp/paasta)
+ paasta_tools/utils.py:3715: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo]")  [return-value]
+ paasta_tools/utils.py:3720: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ paasta_tools/utils.py:3727: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/utils.py:3735: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/tron_tools.py:203: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ paasta_tools/cli/cmds/validate.py:470: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/validate.py:470: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/validate.py:470: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/validate.py:753: error: Argument 1 to "get_next" of "croniter" has incompatible type "Type[datetime[Any]]"; expected "Optional[Union[Type[float], Type[datetime[tzinfo]]]]"  [arg-type]
+ paasta_tools/cli/cmds/logs.py:1241: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]
+ paasta_tools/cli/cmds/logs.py:1241: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/logs.py:1242: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]
+ paasta_tools/cli/cmds/logs.py:1242: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]
+ paasta_tools/cli/cmds/logs.py:1247: error: Incompatible return value type (got "Tuple[datetime[None], datetime[None]]", expected "Tuple[datetime[tzinfo], datetime[tzinfo]]")  [return-value]
+ paasta_tools/cli/cmds/get_image_version.py:144: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "datetime[tzinfo]"  [arg-type]

manticore (https://github.com/trailofbits/manticore)
+ manticore/core/plugin.py:432: error: Argument "default_factory" to "field" has incompatible type overloaded function; expected "Callable[[], datetime[tzinfo | None]]"  [arg-type]
+ manticore/core/plugin.py:436: error: Argument "default_factory" to "field" has incompatible type overloaded function; expected "Callable[[], datetime[tzinfo | None]]"  [arg-type]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:88: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, ts: float, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:90: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:100: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:102: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas/core/arrays/datetimelike.py:1438: error: Argument 1 to "_sub_datetimelike_scalar" of "DatetimeLikeArrayMixin" has incompatible type "datetime[None] | datetime64"; expected "datetime[tzinfo | None] | datetime64"  [arg-type]
+ pandas/io/stata.py:2809: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ pandas/io/stata.py:2830: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/io/stata.py:2831: error: "None" has no attribute "month"  [attr-defined]
+ pandas/io/stata.py:2832: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/io/stata.py:3344: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ pandas/io/stata.py:3364: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/io/stata.py:3365: error: "None" has no attribute "month"  [attr-defined]
+ pandas/io/stata.py:3366: error: "None" has no attribute "strftime"  [attr-defined]
+ pandas/core/indexes/period.py:474: error: Argument 1 to "_cast_partial_indexing_scalar" of "PeriodIndex" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/core/indexes/period.py:500: error: Argument 1 to "_cast_partial_indexing_scalar" of "PeriodIndex" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/io/sas/sas_xport.py:151: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | NaTType")  [return-value]
+ pandas/tests/tseries/offsets/test_business_day.py:145: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:146: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:147: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:148: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:149: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:155: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:156: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:157: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:158: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:159: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:165: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:166: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:167: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:168: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:169: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:170: error: Dict entry 5 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:176: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:177: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:178: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:179: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:180: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:181: error: Dict entry 5 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:182: error: Dict entry 6 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:188: error: Dict entry 0 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:189: error: Dict entry 1 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:190: error: Dict entry 2 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:191: error: Dict entry 3 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/tseries/offsets/test_business_day.py:192: error: Dict entry 4 has incompatible type "datetime[None]": "datetime[None]"; expected "datetime[tzinfo | None]": "datetime[tzinfo | None]"  [dict-item]
+ pandas/tests/scalar/test_nat.py:364: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/tests/scalar/test_nat.py:364: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/tests/scalar/test_nat.py:364: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ pandas/tests/resample/test_datetime_index.py:1314: error: List item 0 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1315: error: List item 1 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1316: error: List item 2 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1317: error: List item 3 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1318: error: List item 4 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]
+ pandas/tests/resample/test_datetime_index.py:1319: error: List item 5 has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | NaTType"  [list-item]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/catalog/test_utils.py: note: In function "test_published_in_future_year":
+ openlibrary/tests/catalog/test_utils.py:239: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ openlibrary/core/db.py:180: error: Argument 2 to "register_adapter" has incompatible type "Callable[[datetime[tzinfo | None]], str]"; expected "Callable[[datetime[None]], str | Buffer | int | float | None]"  [arg-type]
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/core/models.py: note: In member "resolve_redirects_bulk" of class "Work":
+ openlibrary/core/models.py:730: error: Incompatible default for argument "cutoff_date" (default has type "datetime[None]", argument has type "datetime[tzinfo | None]")  [assignment]
+ openlibrary/core/models.py:743: error: Incompatible types in assignment (expression has type "object", variable has type "datetime[tzinfo | None]")  [assignment]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/i18n.py: note: In function "format_date":
+ sphinx/util/i18n.py:228:20: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Optional[datetime[Optional[tzinfo]]]")  [assignment]
+ sphinx/util/i18n.py:230:20: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Optional[datetime[Optional[tzinfo]]]")  [assignment]
+ sphinx/util/i18n.py:249:45: error: Argument 1 to "babel_format_date" has incompatible type "Optional[datetime[Optional[tzinfo]]]"; expected "datetime[Optional[tzinfo]]"  [arg-type]

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/helpers.py:1079:24: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ aiohttp/web_response.py:262:46: error: Never has no attribute "utctimetuple"  [attr-defined]

rich (https://github.com/Textualize/rich)
+ rich/console.py:1969: error: Argument "log_time" to "__call__" of "LogRender" has incompatible type "datetime[tzinfo | None] | datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ rich/_log_render.py:57: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None] | datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ rich/_log_render.py:60: error: Argument 1 has incompatible type "datetime[tzinfo | None] | None"; expected "datetime[tzinfo | None]"  [arg-type]
+ rich/_log_render.py:62: error: Item "None" of "datetime[tzinfo | None] | None" has no attribute "strftime"  [union-attr]
+ rich/logging.py:224: error: Argument "log_time" to "__call__" of "LogRender" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]

optuna (https://github.com/optuna/optuna)
+ optuna/trial/_frozen.py:572: error: Incompatible types in assignment (expression has type "datetime[None] | None", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/trial/_frozen.py:582: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/trial/_fixed.py:179: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]
+ optuna/storages/_in_memory.py:168: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/storages/_in_memory.py:263: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/storages/_in_memory.py:266: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/study/_optimize.py:112: error: Argument 10 to "submit" of "Executor" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/study/_optimize.py:142: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ optuna/study/_optimize.py:154: error: No overload variant of "__sub__" of "datetime" matches argument type "None"  [operator]
+ optuna/study/_optimize.py:154: note: Possible overload variants:
+ optuna/study/_optimize.py:154: note:     def __sub__(self, datetime[tzinfo], /) -> NoReturn
+ optuna/study/_optimize.py:154: note:     def __sub__(self, datetime[Any], /) -> timedelta
+ optuna/study/_optimize.py:154: note:     def __sub__(self, timedelta, /) -> datetime[None]
+ optuna/study/_optimize.py:154: note: Right operand is of type "datetime[tzinfo | None] | None"
+ optuna/study/_optimize.py:173: error: No overload variant of "__sub__" of "datetime" matches argument type "None"  [operator]
+ optuna/study/_optimize.py:173: note: Possible overload variants:
+ optuna/study/_optimize.py:173: note:     def __sub__(self, datetime[tzinfo], /) -> NoReturn
+ optuna/study/_optimize.py:173: note:     def __sub__(self, datetime[Any], /) -> timedelta
+ optuna/study/_optimize.py:173: note:     def __sub__(self, timedelta, /) -> datetime[None]
+ optuna/study/_optimize.py:173: note: Right operand is of type "datetime[tzinfo | None] | None"
+ tests/trial_tests/test_frozen.py:285: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/trial_tests/test_frozen.py:286: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/trial_tests/test_frozen.py:430: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/trial_tests/test_frozen.py:431: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/storages_tests/test_storages.py:301: error: Argument 4 to "_check_trials" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ tests/storages_tests/test_storages.py:301: error: Argument 5 to "_check_trials" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ tests/storages_tests/test_storages.py:1045: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/storages_tests/test_storages.py:1046: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ optuna/visualization/_timeline.py:90: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ optuna/visualization/_timeline.py:94: error: Argument "default" to "max" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ tests/visualization_tests/test_utils.py:186: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:187: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:218: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:219: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:254: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_utils.py:255: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_timeline.py:66: error: Argument "datetime_start" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_timeline.py:67: error: Argument "datetime_complete" to "FrozenTrial" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/visualization_tests/test_timeline.py:103: error: Unsupported left operand type for <= (Never)  [operator]
+ tests/visualization_tests/test_timeline.py:126: error: Unsupported left operand type for < (Never)  [operator]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/options.py:633: error: Incompatible return value type (got "datetime[None]", expected "datetime[Optional[tzinfo]]")  [return-value]
+ tornado/locale.py:352: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[int, float, datetime[Optional[tzinfo]]]")  [assignment]
+ tornado/locale.py:353: error: Item "int" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "tzinfo"  [union-attr]
+ tornado/locale.py:353: error: Item "float" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "tzinfo"  [union-attr]
+ tornado/locale.py:354: error: Item "int" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "replace"  [union-attr]
+ tornado/locale.py:354: error: Item "float" of "Union[int, float, datetime[Optional[tzinfo]]]" has no attribute "replace"  [union-attr]
+ tornado/locale.py:354: error: Incompatible types in assignment (expression has type "Union[Any, datetime[tzinfo]]", variable has type "Union[int, float, datetime[Optional[tzinfo]]]")  [assignment]
+ tornado/locale.py:356: error: Unsupported operand types for > ("int" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:356: error: Unsupported operand types for > ("float" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:356: note: Left operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/locale.py:357: error: Item "int" of "Union[int, float, timedelta]" has no attribute "seconds"  [union-attr]
+ tornado/locale.py:357: error: Item "float" of "Union[int, float, timedelta]" has no attribute "seconds"  [union-attr]
+ tornado/locale.py:357: error: Unsupported operand types for - ("int" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:357: error: Unsupported operand types for - ("float" and "datetime[tzinfo]")  [operator]
+ tornado/locale.py:357: note: Left operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/locale.py:361: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[int, float, datetime[Optional[tzinfo]]]")  [assignment]
+ tornado/locale.py:365: error: Unsupported operand types for - ("int" and "timedelta")  [operator]
+ tornado/locale.py:365: error: Unsupported operand types for - ("float" and "timedelta")  [operator]
+ tornado/locale.py:365: note: Left operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/locale.py:368: error: No overload variant of "__sub__" of "datetime" matches argument type "int"  [operator]
+ tornado/locale.py:368: note: Possible overload variants:
+ tornado/locale.py:368: note:     def __sub__(self, datetime[None], /) -> NoReturn
+ tornado/locale.py:368: note:     def __sub__(self, datetime[Any], /) -> timedelta
+ tornado/locale.py:368: note:     def __sub__(self, timedelta, /) -> datetime[tzinfo]
+ tornado/locale.py:368: error: No overload variant of "__sub__" of "datetime" matches argument type "float"  [operator]
+ tornado/locale.py:368: note: Right operand is of type "Union[int, float, datetime[Optional[tzinfo]]]"
+ tornado/httputil.py:870: error: Never has no attribute "utctimetuple"  [attr-defined]
+ tornado/web.py:650: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[float, Tuple[Any, ...], datetime[Optional[tzinfo]], None]")  [assignment]
+ tornado/web.py:706: error: Argument "expires" to "set_cookie" of "RequestHandler" has incompatible type "datetime[tzinfo]"; expected "Union[float, Tuple[Any, ...], datetime[Optional[tzinfo]], None]"  [arg-type]
+ tornado/web.py:2800: error: Argument 2 to "set_header" of "RequestHandler" has incompatible type "datetime[tzinfo]"; expected "Union[bytes, str, int, Integral, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/web.py:2800: note: Types from "numbers" aren't supported for static type checking
+ tornado/web.py:2800: note: See https://peps.python.org/pep-0484/#the-numeric-tower
+ tornado/web.py:2800: note: Consider using a protocol instead, such as typing.SupportsFloat
+ tornado/web.py:2822: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ tornado/web.py:3006: error: Incompatible return value type (got "datetime[tzinfo]", expected "Optional[datetime[Optional[tzinfo]]]")  [return-value]
+ tornado/test/locale_test.py:91: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:100: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:100: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:106: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:106: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:112: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:112: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:119: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:119: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:126: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:128: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:132: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:134: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:138: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:140: error: Argument 1 to "format_date" of "Locale" has incompatible type "datetime[None]"; expected "Union[int, float, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/locale_test.py:158: error: Argument "date" to "format_day" of "Locale" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tornado/test/locale_test.py:159: error: Argument "date" to "format_day" of "Locale" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tornado/test/web_test.py:3063: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ tornado/test/httpclient_test.py:891: error: Argument "if_modified_since" to "HTTPRequest" has incompatible type "datetime[tzinfo]"; expected "Union[float, datetime[Optional[tzinfo]], None]"  [arg-type]
+ tornado/test/httpclient_test.py:893: error: Argument 1 to "format_timestamp" has incompatible type "datetime[tzinfo]"; expected "Union[int, float, Tuple[Any, ...], struct_time, datetime[Optional[tzinfo]]]"  [arg-type]
+ tornado/test/httpclient_test.py:899: error: Argument "if_modified_since" to "HTTPRequest" has incompatible type "datetime[None]"; expected "Union[float, datetime[Optional[tzinfo]], None]"  [arg-type]
+ tornado/test/httpclient_test.py:901: error: Argument 1 to "format_timestamp" has incompatible type "datetime[None]"; expected "Union[int, float, Tuple[Any, ...], struct_time, datetime[Optional[tzinfo]]]"  [arg-type]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/dbapi20.py:113: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/dbapi20.py:122: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/dbapi20.py:122: note: Perhaps you need a type annotation for "rv"? Suggestion: "datetime[tzinfo | None]"
+ psycopg/psycopg/types/datetime.py:464: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:475: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:542: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:548: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:576: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ psycopg/psycopg/types/datetime.py:593: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]
+ tests/test_connection_info.py:173: error: Argument 1 to "utcoffset" of "tzinfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ tests/test_connection_info.py:175: error: Argument 1 to "utcoffset" of "tzinfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | None"  [arg-type]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/_internal.py:113: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/_internal.py:115: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/http.py:983: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/http.py:1010: error: Argument 1 to "_dt_as_utc" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/werkzeug/http.py:1012: error: Argument 1 to "format_datetime" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/werkzeug/sansio/response.py:445: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None] | None")  [return-value]
+ src/werkzeug/middleware/shared_data.py:150: error: Incompatible return value type (got "Callable[[], tuple[BufferedReader, datetime[tzinfo], int]]", expected "Callable[[], tuple[IO[bytes], datetime[tzinfo | None], int]]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:150: error: Incompatible return value type (got "tuple[BufferedReader, datetime[tzinfo], int]", expected "tuple[IO[bytes], datetime[tzinfo | None], int]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:183: error: Incompatible return value type (got "tuple[str, Callable[[], tuple[BytesIO, datetime[tzinfo], int]]]", expected "tuple[str | None, Callable[[], tuple[IO[bytes], datetime[tzinfo | None], int]] | None]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:185: error: Incompatible return value type (got "tuple[BytesIO, datetime[tzinfo], int]", expected "tuple[IO[bytes], datetime[tzinfo | None], int]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:188: error: Incompatible return value type (got "tuple[str, Callable[[], tuple[Any, datetime[tzinfo], int]]]", expected "tuple[str | None, Callable[[], tuple[IO[bytes], datetime[tzinfo | None], int]] | None]")  [return-value]
+ src/werkzeug/middleware/shared_data.py:190: error: Incompatible return value type (got "tuple[Any, datetime[tzinfo], int]", expected "tuple[IO[bytes], datetime[tzinfo | None], int]")  [return-value]
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ tests/test_send_file.py:39: error: Argument "last_modified" to "send_file" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | int | float | None"  [arg-type]
+ tests/test_send_file.py:133: error: Argument "last_modified" to "send_file" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | int | float | None"  [arg-type]
+ tests/test_http.py:422: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:425: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:438: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:451: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:454: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]
+ tests/test_http.py:457: error: Argument "last_modified" to "is_resource_modified" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None] | str | None"  [arg-type]

boostedblob (https://github.com/hauntsaninja/boostedblob)
+ boostedblob/google_auth.py:253: error: Incompatible return value type (got "Tuple[str, datetime[None]]", expected "Tuple[str, datetime[Optional[tzinfo]]]")  [return-value]
+ boostedblob/azure_auth.py:638: error: Incompatible return value type (got "Tuple[str, datetime[None]]", expected "Tuple[str, datetime[Optional[tzinfo]]]")  [return-value]
+ boostedblob/_recover.py:226: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "Union[str, datetime[Optional[tzinfo]]]")  [assignment]

PyGithub (https://github.com/PyGithub/PyGithub)
+ github/GithubObject.py:87: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ github/GithubObject.py:276: error: Argument 3 to "__makeTransformedAttribute" of "GithubObject" has incompatible type "Callable[[int], datetime[tzinfo]]"; expected "Callable[[int], datetime[tzinfo | None]]"  [arg-type]
+ github/GithubObject.py:276: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ github/AccessToken.py:145: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None]")  [assignment]
+ github/Issue.py:408: error: Never has no attribute "strftime"  [attr-defined]
+ github/AuthenticatedUser.py:958: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ github/AuthenticatedUser.py:960: error: Never has no attribute "strftime"  [attr-defined]
+ github/Repository.py:3553: error: Incompatible default for argument "last_read_at" (default has type "datetime[tzinfo]", argument has type "datetime[tzinfo | None]")  [assignment]
+ github/Repository.py:3559: error: Never has no attribute "strftime"  [attr-defined]

kopf (https://github.com/nolar/kopf)
+ kopf/_cogs/structs/credentials.py:241: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ kopf/_cogs/structs/credentials.py:395: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "object"  [type-var]
+ kopf/_cogs/structs/credentials.py:395: error: Incompatible types in assignment (expression has type "object", variable has type "datetime[tzinfo | None] | None")  [assignment]
+ kopf/_core/actions/execution.py:126: error: No overload variant of "__sub__" of "datetime" matches argument type "object"  [operator]
+ kopf/_core/actions/execution.py:126: note: Possible overload variants:
+ kopf/_core/actions/execution.py:126: note:     def __sub__(self, datetime[None], /) -> NoReturn
+ kopf/_core/actions/execution.py:126: note:     def __sub__(self, datetime[Any], /) -> timedelta
+ kopf/_core/actions/execution.py:126: note:     def __sub__(self, timedelta, /) -> datetime[tzinfo]
+ kopf/_core/actions/execution.py:280: error: Argument "started" to "invoke_handler" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ kopf/_core/actions/progression.py:59: error: Argument "started" to "HandlerState" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:67: error: Argument "started" to "HandlerState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:114: error: Argument "started" to "HandlerState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo]"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:115: error: Argument "stopped" to "HandlerState" has incompatible type "datetime[tzinfo | None] | datetime[tzinfo] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/actions/progression.py:116: error: Argument "delayed" to "HandlerState" has incompatible type "datetime[tzinfo] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ kopf/_core/engines/probing.py:67: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None] | None")  [assignment]

starlette (https://github.com/encode/starlette)
+ tests/test_convertors.py:27: error: Incompatible return value type (got "datetime[None]", expected "datetime[Optional[tzinfo]]")  [return-value]

dragonchain (https://github.com/dragonchain/dragonchain)
+ dragonchain/lib/authorization.py:51:12: error: Incompatible return value type (got "datetime[None]", expected "datetime[Optional[tzinfo]]")  [return-value]

spark (https://github.com/apache/spark)
+ python/pyspark/sql/variant_utils.py:221: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/variant_utils.py:226: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/types.py:379: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/types.py:400: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None]")  [return-value]
+ python/pyspark/sql/connect/expressions.py:259: error: Argument 1 to "toInternal" of "TimestampType" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ python/pyspark/sql/connect/expressions.py:262: error: Argument 1 to "toInternal" of "TimestampNTZType" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/streaming/dstream.py:581: error: Never has no attribute "timetuple"  [attr-defined]

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ scheduler/time_utils.py:42: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/time_utils.py:42: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/time_utils.py:42: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/time_utils.py:54: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ embedmaker/time_utils.py:42: error: Argument 1 to "localize" of "_UTCclass" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ embedmaker/time_utils.py:42: error: Argument 1 to "localize" of "StaticTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ embedmaker/time_utils.py:42: error: Argument 1 to "localize" of "DstTzInfo" has incompatible type "datetime[None]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ embedmaker/time_utils.py:54: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ scheduler/converters.py:96: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ scheduler/converters.py:144: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ guildjoinrestrict/core.py:322: error: Argument 3 to "EventQueueItem" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/tasks.py:41: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ scheduler/tasks.py:89: error: Argument "initial" to "Task" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/scheduler.py:767: error: Argument "initial" to "Task" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ scheduler/scheduler.py:830: error: Argument "initial" to "Task" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]

operator (https://github.com/canonical/operator)
+ ops/_private/timeconv.py:62: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ ops/model.py:483: error: Incompatible return value type (got "datetime[None]", expected "datetime[tzinfo | None] | None")  [return-value]
+ ops/model.py:2540: error: Argument "last_modified" to "FileInfo" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:2695: error: Argument "rotates" to "SecretInfo" has incompatible type "datetime[None] | None"; expected "datetime[tzinfo | None] | None"  [arg-type]
+ ops/testing.py:3482: error: Argument "first_occurred" to "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:3483: error: Argument "last_occurred" to "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:3484: error: Argument "last_repeated" to "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]
+ ops/testing.py:3497: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[tzinfo | None]")  [assignment]
+ ops/testing.py:3501: error: Argument "last_occurred" to "replace" of "Notice" has incompatible type "datetime[tzinfo]"; expected "datetime[tzinfo | None]"  [arg-type]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/conversion.py:1409: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[Optional[tzinfo]]")  [return-value]
+ tanjun/conversion.py:1456: error: Argument 1 to "from_datetime" has incompatible type "datetime[tzinfo]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tanjun/schedules.py:1005: error: Argument "current_date" to "_TimeScheduleConfig" has incompatible type "Union[datetime[tzinfo], datetime[None]]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tanjun/schedules.py:1044: error: Incompatible types in assignment (expression has type "Union[datetime[tzinfo], datetime[None]]", variable has type "datetime[Optional[tzinfo]]")  [assignment]
+ tanjun/schedules.py:1076: error: Argument 2 to "_Datetime" has incompatible type "Union[datetime[tzinfo], datetime[None]]"; expected "datetime[Optional[tzinfo]]"  [arg-type]
+ tanjun/dependencies/limiters.py:499: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[Optional[tzinfo]]")  [return-value]

bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch_storage_plugins/swift.py: note: In member "get_upload_time" of class "SwiftStorage":
+ src/bandersnatch_storage_plugins/swift.py:989: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ src/bandersnatch_storage_plugins/s3.py: note: In member "get_upload_time" of class "S3Storage":
+ src/bandersnatch_storage_plugins/s3.py:430: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ src/bandersnatch_storage_plugins/filesystem.py: note: In member "get_upload_time" of class "FilesystemStorage":
+ src/bandersnatch_storage_plugins/filesystem.py:286: error: Incompatible return value type (got "datetime[tzinfo]", expected "datetime[tzinfo | None]")  [return-value]
+ src/bandersnatch/tests/plugins/test_storage_plugins.py: note: In function "get_swift_file_attrs":
+ src/bandersnatch/tests/plugins/test_storage_plugins.py:44: error: Argument 1 to "get_swift_date" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/bandersnatch/tests/plugins/test_storage_plugins.py: note: In member "head_object" of class "MockConnection":
+ src/bandersnatch/tests/plugins/test_storage_plugins.py:188: error: Argument 1 to "get_swift_object_date" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]
+ src/bandersnatch/tests/plugins/test_storage_plugin_s3.py: note: In function "test_upload_time":
+ src/bandersnatch/tests/plugins/test_storage_plugin_s3.py:251: error: Argument 2 to "set_upload_time" of "S3Storage" has incompatible type "datetime[None]"; expected "datetime[tzinfo | None]"  [arg-type]

mkosi (https://github.com/systemd/mkosi)
+ mkosi/manifest.py:90:88: error: Argument "default_factory" to "field" has incompatible type overloaded function; expected "Callable[[], datetime[Optional[tzinfo]]]"  [arg-type]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, t: float, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:115: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:129: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:159: error: Return type "Timestamp" of "astimezone" incompatible with return type "datetime[tzinfo]" in supertype "datetime"  [override]
+ tests/test_timefuncs.py:79: error: Unsupported operand types for - ("Timestamp" and "datetime[None]")  [operator]
+ tests/test_timefuncs.py:167: error: Unsupported operand types for - ("TimestampSeries" and "datetime[None]")  [operator]
+ tests/test_scalars.py:539: error: Expression is of type "date", not "Timestamp"  [assert-type]
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]
+ tests/test_scalars.py:1334: error: Expression is of type "Literal[False]", not "bool"  [assert-type]
+ tests/test_scalars.py:1335: error: Expression is of type "Literal[True]", not "bool"  [assert-type]
+ tests/test_scalars.py:1633: error: Unsupported operand types for - ("Timestamp" and "datetime[None]")  [operator]
+ tests/test_indexes.py:232: error: Argument 1 to "interval_range" has incompatible type "datetime[None]"; expected "Timestamp | datetime64 | datetime[tzinfo | None]"  [arg-type]
+ tests/test_indexes.py:232: error: Argument 2 to "interval_range" has incompatible type "datetime[None]"; expected "Timestamp | datetime64 | datetime[tzinfo | None]"  [arg-type]
+ tests/test_indexes.py:305: error: Argument 2 to "interval_range" has incompatible type "datetime[None]"; expected "Timestamp | datetime64 | datetime[tzinfo | None]"  [arg-type]
+ tests/test_indexes.py:472: error: Expression is of type "IntervalIndex[Interval[int]]", not "IntervalIndex[Interval[Timestamp]]"  [assert-type]
+ tests/test_indexes.py:475: error: List item 0 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:476: error: List item 1 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:477: error: List item 2 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:478: error: List item 3 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:586: error: Expression is of type "IntervalIndex[Interval[int]]", not "IntervalIndex[Interval[Timestamp]]"  [assert-type]
+ tests/test_indexes.py:589: error: List item 0 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:590: error: List item 1 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:591: error: List item 2 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:592: error: List item 3 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:595: error: List item 0 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:596: error: List item 1 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:597: error: List item 2 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:598: error: List item 3 has incompatible type "datetime[None]"; expected "int"  [list-item]
+ tests/test_indexes.py:639: error: Expression is of type "IntervalIndex[Interval[int]]", not "IntervalIndex[Interval[Timestamp]]"  [assert-type]
+ tests/test_indexes.py:642: error: List item 0 has incompatible type "tuple[datetime[None], datetime[None]]"; expected "tuple[int, int]"  [list-item]
+ tests/test_indexes.py:643: error: List item 1 has incompatible type "tuple[datetime[None], datetime[None]]"; expected "tuple[int, int]"  [list-item]
+ tests/test_indexes.py:835: error: Argument 1 to "interval_range" has incompatible type "datetime[None]"; expected "Timestamp | datetime64 | datetime[tzinfo | None]"  [arg-type]
+ tests/test_indexes.py:835: error: Argument 2 to "interval_range" has incompatible type "datetime[None]"; expected "Timestamp | datetime64 | datetime[tzinfo | None]"  [arg-type]
+ tests/test_indexes.py:1071: error: Unsupported operand types for - ("DatetimeIndex" and "d

... (truncated 195 lines) ...

github-actions[bot] avatar Apr 29 '24 12:04 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[Any]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: No overload variant of "__gt__" of "datetime" matches argument type "None"  [operator]
+ steam/abc.py:668: note: Possible overload variants:
+ steam/abc.py:668: note:     def __gt__(self, datetime[None], /) -> NoReturn
+ steam/abc.py:668: note:     def __gt__(self, datetime[tzinfo], /) -> NoReturn
+ steam/abc.py:668: note:     def __gt__(self, datetime[Any], /) -> bool
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[Any] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: No overload variant of "__lt__" of "datetime" matches argument type "None"  [operator]
+ steam/abc.py:668: note:     def __lt__(self, datetime[None], /) -> NoReturn
+ steam/abc.py:668: note:     def __lt__(self, datetime[tzinfo], /) -> NoReturn
+ steam/abc.py:668: note:     def __lt__(self, datetime[Any], /) -> bool
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[Any] | None"
+ steam/abc.py:1120: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

aiortc (https://github.com/aiortc/aiortc)
+ src/aiortc/clock.py:11: error: Need type annotation for "delta"  [var-annotated]
+ src/aiortc/clock.py:12: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
+ src/aiortc/clock.py:26: error: Need type annotation for "delta"  [var-annotated]
+ src/aiortc/clock.py:27: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
+ src/aiortc/clock.py:28: error: "NoReturn" has no attribute "microseconds"  [attr-defined]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:148: error: Signatures of "__le__" of "Timestamp" and "__ge__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:148: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:149: error: Signatures of "__lt__" of "Timestamp" and "__gt__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:149: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:150: error: Signatures of "__ge__" of "Timestamp" and "__le__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:150: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:151: error: Signatures of "__gt__" of "Timestamp" and "__lt__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:151: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/io/stata.py:411: error: "NoReturn" has no attribute "days"  [attr-defined]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/locale_test.py:100: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:100: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:106: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:106: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:112: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:112: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:119: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:119: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:126: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:132: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:138: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/datetime.py:170: error: Need type annotation for "delta"  [var-annotated]
+ psycopg/psycopg/types/datetime.py:171: error: "NoReturn" has no attribute "microseconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:171: error: "NoReturn" has no attribute "days"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:171: error: "NoReturn" has no attribute "seconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:186: error: Need type annotation for "delta"  [var-annotated]
+ psycopg/psycopg/types/datetime.py:187: error: "NoReturn" has no attribute "microseconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:187: error: "NoReturn" has no attribute "days"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:187: error: "NoReturn" has no attribute "seconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

werkzeug (https://github.com/pallets/werkzeug)
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[Any] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[Any] | None")  [assignment]

kopf (https://github.com/nolar/kopf)
+ kopf/_core/actions/progression.py:320: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

spark (https://github.com/apache/spark)
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[Any], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[Any], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ scheduler/tasks.py:104: error: Returning Any from function declared to return "float"  [no-any-return]
+ scheduler/tasks.py:106: error: Returning Any from function declared to return "float"  [no-any-return]
+ scheduler/tasks.py:106: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[Any]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[Any]"  [assert-type]

ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
+ ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime[Any] | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
- ibis/backends/exasol/__init__.py:269: error: "datetime" has no attribute "tz_convert"  [attr-defined]

discord.py (https://github.com/Rapptz/discord.py)
+ discord/utils.py:733: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
- discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo]")  [assignment]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime[Any]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime[Any] | None
- discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime[Any]
- discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime[Any] | None
- discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[Any]")  [assignment]
- discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime" and "None")  [operator]
+ discord/ext/tasks/__init__.py:226: error: No overload variant of "__ge__" of "datetime" matches argument type "None"  [operator]
+ discord/ext/tasks/__init__.py:226: note: Possible overload variants:
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[None], /) -> NoReturn
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[tzinfo], /) -> NoReturn
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[Any], /) -> bool
- discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime[Any]"  [arg-type]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/json_util.py:925: error: Unused "type: ignore" comment  [unused-ignore]
+ pymongo/server_description.py:108: error: Need type annotation for "delta"  [var-annotated]
+ pymongo/server_description.py:109: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/generic.py:93: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:95: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:105: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:107: error: Returning Any from function declared to return "bool"  [no-any-return]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/config_option.py: note: In member "is_expired" of class "ConfigOption":
+ lib/streamlit/config_option.py:305:9: error: Returning Any from function declared to return "bool"  [no-any-return]
- lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime[Any], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
- lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime[Any], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime | date | time | datetime64" due to an unfollowed import  [no-any-unimported]
+ src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime[Any] | date | time | datetime64" due to an unfollowed import  [no-any-unimported]

alerta (https://github.com/alerta/alerta)
- alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime[Any]")  [assignment]
- alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime[Any] | None"; expected "datetime[Any]"  [arg-type]
- alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime[Any]")  [assignment]
- alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime[Any] | None"; expected "datetime[Any]"  [arg-type]

github-actions[bot] avatar Apr 29 '24 12:04 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[Any]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: No overload variant of "__gt__" of "datetime" matches argument type "None"  [operator]
+ steam/abc.py:668: note: Possible overload variants:
+ steam/abc.py:668: note:     def __gt__(self, datetime[None], /) -> NoReturn
+ steam/abc.py:668: note:     def __gt__(self, datetime[tzinfo], /) -> NoReturn
+ steam/abc.py:668: note:     def __gt__(self, datetime[Any], /) -> bool
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[Any] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: No overload variant of "__lt__" of "datetime" matches argument type "None"  [operator]
+ steam/abc.py:668: note:     def __lt__(self, datetime[None], /) -> NoReturn
+ steam/abc.py:668: note:     def __lt__(self, datetime[tzinfo], /) -> NoReturn
+ steam/abc.py:668: note:     def __lt__(self, datetime[Any], /) -> bool
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[Any] | None"
+ steam/abc.py:1120: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

aiortc (https://github.com/aiortc/aiortc)
+ src/aiortc/clock.py:11: error: Need type annotation for "delta"  [var-annotated]
+ src/aiortc/clock.py:12: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
+ src/aiortc/clock.py:26: error: Need type annotation for "delta"  [var-annotated]
+ src/aiortc/clock.py:27: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
+ src/aiortc/clock.py:28: error: "NoReturn" has no attribute "microseconds"  [attr-defined]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:148: error: Signatures of "__le__" of "Timestamp" and "__ge__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:148: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:149: error: Signatures of "__lt__" of "Timestamp" and "__gt__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:149: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:150: error: Signatures of "__ge__" of "Timestamp" and "__le__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:150: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:151: error: Signatures of "__gt__" of "Timestamp" and "__lt__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:151: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/io/stata.py:411: error: "NoReturn" has no attribute "days"  [attr-defined]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/locale_test.py:100: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:100: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:106: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:106: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:112: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:112: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:119: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:119: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:126: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:132: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:138: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/datetime.py:170: error: Need type annotation for "delta"  [var-annotated]
+ psycopg/psycopg/types/datetime.py:171: error: "NoReturn" has no attribute "microseconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:171: error: "NoReturn" has no attribute "days"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:171: error: "NoReturn" has no attribute "seconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:186: error: Need type annotation for "delta"  [var-annotated]
+ psycopg/psycopg/types/datetime.py:187: error: "NoReturn" has no attribute "microseconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:187: error: "NoReturn" has no attribute "days"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:187: error: "NoReturn" has no attribute "seconds"  [attr-defined]
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

werkzeug (https://github.com/pallets/werkzeug)
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[Any] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[Any] | None")  [assignment]

kopf (https://github.com/nolar/kopf)
+ kopf/_core/actions/progression.py:320: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

spark (https://github.com/apache/spark)
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[Any], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[Any], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ scheduler/tasks.py:104: error: Returning Any from function declared to return "float"  [no-any-return]
+ scheduler/tasks.py:106: error: Returning Any from function declared to return "float"  [no-any-return]
+ scheduler/tasks.py:106: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[Any]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[Any]"  [assert-type]

ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
+ ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime[Any] | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
- ibis/backends/exasol/__init__.py:269: error: "datetime" has no attribute "tz_convert"  [attr-defined]

discord.py (https://github.com/Rapptz/discord.py)
+ discord/utils.py:733: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
- discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo]")  [assignment]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime[Any]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime[Any] | None
- discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime[Any]
- discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime[Any] | None
- discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[Any]")  [assignment]
- discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime" and "None")  [operator]
+ discord/ext/tasks/__init__.py:226: error: No overload variant of "__ge__" of "datetime" matches argument type "None"  [operator]
+ discord/ext/tasks/__init__.py:226: note: Possible overload variants:
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[None], /) -> NoReturn
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[tzinfo], /) -> NoReturn
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[Any], /) -> bool
- discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime[Any]"  [arg-type]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/json_util.py:925: error: Unused "type: ignore" comment  [unused-ignore]
+ pymongo/server_description.py:108: error: Need type annotation for "delta"  [var-annotated]
+ pymongo/server_description.py:109: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/generic.py:93: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:95: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:105: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:107: error: Returning Any from function declared to return "bool"  [no-any-return]

alerta (https://github.com/alerta/alerta)
- alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime[Any]")  [assignment]
- alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime[Any] | None"; expected "datetime[Any]"  [arg-type]
- alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime[Any]")  [assignment]
- alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime[Any] | None"; expected "datetime[Any]"  [arg-type]

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime | date | time | datetime64" due to an unfollowed import  [no-any-unimported]
+ src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime[Any] | date | time | datetime64" due to an unfollowed import  [no-any-unimported]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/config_option.py: note: In member "is_expired" of class "ConfigOption":
+ lib/streamlit/config_option.py:305:9: error: Returning Any from function declared to return "bool"  [no-any-return]
- lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime[Any], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
- lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime[Any], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time

github-actions[bot] avatar Apr 29 '24 13:04 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo | None]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for > ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[tzinfo | None] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for < ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[tzinfo | None] | None"

paasta (https://github.com/yelp/paasta)
+ paasta_tools/cli/cmds/status.py:1003: error: Need type annotation for "pod_uptime"  [var-annotated]
+ paasta_tools/cli/cmds/status.py:1004: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
+ paasta_tools/cli/cmds/status.py:2150: error: Need type annotation for "delta"  [var-annotated]
+ paasta_tools/cli/cmds/logs.py:1241: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]
+ paasta_tools/cli/cmds/logs.py:1242: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:88: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, ts: float, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:90: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:92: error: Signature of "today" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:92: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          def today(cls) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:92: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          def today(cls, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:100: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:102: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "datetime[Optional[tzinfo]]", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "datetime[Optional[tzinfo]]", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "datetime[Optional[tzinfo]]", variable has type "datetime[None]")  [assignment]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

werkzeug (https://github.com/pallets/werkzeug)
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]

spark (https://github.com/apache/spark)
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, t: float, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:115: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: error: Signature of "today" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          def today(cls) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          def today(cls, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:129: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:159: error: Return type "Timestamp" of "astimezone" incompatible with return type "datetime[tzinfo]" in supertype "datetime"  [override]
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]

ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
+ ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime[tzinfo | None] | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
- ibis/backends/exasol/__init__.py:269: error: "datetime" has no attribute "tz_convert"  [attr-defined]

discord.py (https://github.com/Rapptz/discord.py)
- discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo]")  [assignment]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime[tzinfo | None]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime[tzinfo | None] | None
- discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime[tzinfo | None]
- discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime[tzinfo | None] | None
- discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]
- discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo | None]")  [assignment]
- discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime" and "None")  [operator]
+ discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime[tzinfo | None]" and "None")  [operator]
- discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]
- discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]
- discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/json_util.py:924: error: Item "None" of "tzinfo | None" has no attribute "utcoffset"  [union-attr]

alerta (https://github.com/alerta/alerta)
- alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime[tzinfo | None]")  [assignment]
- alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime[tzinfo | None] | None"; expected "datetime[tzinfo | None]"  [arg-type]
- alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime[tzinfo | None]")  [assignment]
- alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime[tzinfo | None] | None"; expected "datetime[tzinfo | None]"  [arg-type]

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime | date | time | datetime64" due to an unfollowed import  [no-any-unimported]
+ src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime[tzinfo | None] | date | time | datetime64" due to an unfollowed import  [no-any-unimported]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime[Optional[tzinfo]], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
- lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime[Optional[tzinfo]], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time

github-actions[bot] avatar Apr 29 '24 13:04 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo | None]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for > ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[tzinfo | None] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: Unsupported operand types for < ("datetime[tzinfo | None]" and "None")  [operator]
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[tzinfo | None] | None"

paasta (https://github.com/yelp/paasta)
+ paasta_tools/cli/cmds/status.py:1003: error: Need type annotation for "pod_uptime"  [var-annotated]
+ paasta_tools/cli/cmds/status.py:1004: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]
+ paasta_tools/cli/cmds/status.py:2150: error: Need type annotation for "delta"  [var-annotated]
+ paasta_tools/cli/cmds/logs.py:1241: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]
+ paasta_tools/cli/cmds/logs.py:1242: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "datetime[None]")  [assignment]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:88: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:88: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:88: note:          def fromtimestamp(cls, ts: float, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:90: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:92: error: Signature of "today" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:92: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          def today(cls) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:92: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:92: note:          def today(cls, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:100: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Superclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @overload
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas/_libs/tslibs/timestamps.pyi:100: note:      Subclass:
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          @classmethod
+ pandas/_libs/tslibs/timestamps.pyi:100: note:          def now(cls, tz: str | tzinfo | int | None = ...) -> Timestamp
+ pandas/_libs/tslibs/timestamps.pyi:102: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "datetime[Optional[tzinfo]]", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "datetime[Optional[tzinfo]]", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "datetime[Optional[tzinfo]]", variable has type "datetime[None]")  [assignment]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

werkzeug (https://github.com/pallets/werkzeug)
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[tzinfo | None] | None")  [assignment]

spark (https://github.com/apache/spark)
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[tzinfo | None], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: error: Signature of "fromtimestamp" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, float, /, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:107: note:          def fromtimestamp(cls, t: float, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:115: error: Return type "Timestamp" of "utcfromtimestamp" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: error: Signature of "today" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          def today(cls) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:117: note:          def today(cls, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: error: Signature of "now" incompatible with supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Superclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: None = ...) -> datetime[None]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @overload
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo) -> datetime[tzinfo]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:      Subclass:
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          @classmethod
+ pandas-stubs/_libs/tslibs/timestamps.pyi:127: note:          def now(cls, tz: tzinfo | str | None = ...) -> Timestamp
+ pandas-stubs/_libs/tslibs/timestamps.pyi:129: error: Return type "Timestamp" of "utcnow" incompatible with return type "datetime[None]" in supertype "datetime"  [override]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:159: error: Return type "Timestamp" of "astimezone" incompatible with return type "datetime[tzinfo]" in supertype "datetime"  [override]
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[tzinfo | None]"  [assert-type]

ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
+ ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime[tzinfo | None] | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
- ibis/backends/exasol/__init__.py:269: error: "datetime" has no attribute "tz_convert"  [attr-defined]

discord.py (https://github.com/Rapptz/discord.py)
- discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo]")  [assignment]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime[tzinfo | None]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime[tzinfo | None] | None
- discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime[tzinfo | None]
- discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime[tzinfo | None] | None
- discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]
- discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo | None]")  [assignment]
- discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime" and "None")  [operator]
+ discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime[tzinfo | None]" and "None")  [operator]
- discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]
- discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]
- discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime[tzinfo | None]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime[tzinfo | None]"  [arg-type]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/json_util.py:924: error: Item "None" of "tzinfo | None" has no attribute "utcoffset"  [union-attr]

alerta (https://github.com/alerta/alerta)
- alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime[tzinfo | None]")  [assignment]
- alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime[tzinfo | None] | None"; expected "datetime[tzinfo | None]"  [arg-type]
- alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime[tzinfo | None]")  [assignment]
- alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime[tzinfo | None] | None"; expected "datetime[tzinfo | None]"  [arg-type]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime[Optional[tzinfo]], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
- lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime[Optional[tzinfo]], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime | date | time | datetime64" due to an unfollowed import  [no-any-unimported]
+ src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime[tzinfo | None] | date | time | datetime64" due to an unfollowed import  [no-any-unimported]

github-actions[bot] avatar Apr 29 '24 13:04 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ steam/app.py:461: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[Any]")  [assignment]
- steam/abc.py:668: error: Unsupported operand types for > ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: No overload variant of "__gt__" of "datetime" matches argument type "None"  [operator]
+ steam/abc.py:668: note: Possible overload variants:
+ steam/abc.py:668: note:     def __gt__(self, datetime[tzinfo] | datetime[tzinfo | None], /) -> bool
+ steam/abc.py:668: note:     def __gt__(self, datetime[None] | datetime[tzinfo | None], /) -> bool
+ steam/abc.py:668: note:     def __gt__(self, datetime[Any], /) -> NoReturn
- steam/abc.py:668: note: Left operand is of type "datetime | None"
+ steam/abc.py:668: note: Left operand is of type "datetime[Any] | None"
- steam/abc.py:668: error: Unsupported operand types for < ("datetime" and "None")  [operator]
+ steam/abc.py:668: error: No overload variant of "__lt__" of "datetime" matches argument type "None"  [operator]
+ steam/abc.py:668: note:     def __lt__(self, datetime[tzinfo] | datetime[tzinfo | None], /) -> bool
+ steam/abc.py:668: note:     def __lt__(self, datetime[None] | datetime[tzinfo | None], /) -> bool
+ steam/abc.py:668: note:     def __lt__(self, datetime[Any], /) -> NoReturn
- steam/abc.py:668: note: Right operand is of type "datetime | None"
+ steam/abc.py:668: note: Right operand is of type "datetime[Any] | None"

pandas (https://github.com/pandas-dev/pandas)
+ pandas/_libs/tslibs/timestamps.pyi:148: error: Signatures of "__le__" of "Timestamp" and "__ge__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:148: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:149: error: Signatures of "__lt__" of "Timestamp" and "__gt__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:149: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:150: error: Signatures of "__ge__" of "Timestamp" and "__le__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:150: note: Error code "misc" not covered by "type: ignore" comment
+ pandas/_libs/tslibs/timestamps.pyi:151: error: Signatures of "__gt__" of "Timestamp" and "__lt__" of "datetime[Any]" are unsafely overlapping  [misc]
+ pandas/_libs/tslibs/timestamps.pyi:151: note: Error code "misc" not covered by "type: ignore" comment

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/core/test_unmarshal.py:32: error: Unused "type: ignore" comment  [unused-ignore]
+ openlibrary/tests/core/test_unmarshal.py: note: In function "parse_datetime":
+ openlibrary/tests/core/test_unmarshal.py:32: error: No overload variant of "datetime" matches argument type "Generator[int, None, None]"  [call-overload]
+ openlibrary/tests/core/test_unmarshal.py:32: note: Error code "call-overload" not covered by "type: ignore" comment
+ openlibrary/tests/core/test_unmarshal.py:32: note: Possible overload variants:
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ openlibrary/tests/core/test_unmarshal.py:32: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/locale_test.py:100: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:100: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:106: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:106: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:112: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:112: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:119: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:119: error: Argument 1 to "format_date" of "Locale" has incompatible type "timedelta"; expected "Union[int, float, datetime[Any]]"  [arg-type]
+ tornado/test/locale_test.py:126: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:126: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:132: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:132: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]
+ tornado/test/locale_test.py:138: error: Unsupported operand types for - ("object" and "timedelta")  [operator]
+ tornado/test/locale_test.py:138: error: Incompatible types in assignment (expression has type "timedelta", variable has type "datetime[None]")  [assignment]

psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/datetime.py:589: error: Incompatible types in assignment (expression has type "datetime[None]", variable has type "datetime[tzinfo]")  [assignment]
+ tests/types/test_datetime.py:807: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/types/test_datetime.py:807: error: No overload variant of "datetime" matches argument type "map[int]"  [call-overload]
+ tests/types/test_datetime.py:807: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/types/test_datetime.py:807: note: Possible overload variants:
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., tzinfo: None = ..., *, fold: int = ...) -> datetime[None]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex = ..., minute: SupportsIndex = ..., second: SupportsIndex = ..., microsecond: SupportsIndex = ..., *, tzinfo: tzinfo, fold: int = ...) -> datetime[tzinfo]
+ tests/types/test_datetime.py:807: note:     def [_TzInfoT] __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex, hour: SupportsIndex, minute: SupportsIndex, second: SupportsIndex, microsecond: SupportsIndex, tzinfo: tzinfo, *, fold: int = ...) -> datetime[tzinfo]

werkzeug (https://github.com/pallets/werkzeug)
- tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:543: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[Any] | None")  [assignment]
- tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime | None")  [assignment]
+ tests/test_wrappers.py:587: error: Incompatible types in assignment (expression has type "int", variable has type "datetime[Any] | None")  [assignment]

spark (https://github.com/apache/spark)
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[Any], date, Decimal, bool, str, int, float)] createDataFrame(self, data: RDD[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
- python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime, date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame
+ python/pyspark/sql/session.py:1254: note:          def [AtomicValue in (datetime[Any], date, Decimal, bool, str, int, float)] createDataFrame(self, data: Iterable[AtomicValue], schema: AtomicType | str, verifySchema: bool = ...) -> DataFrame

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/schedules.py:1077: error: Need type annotation for "result"  [var-annotated]
+ tanjun/schedules.py:1078: error: "NoReturn" has no attribute "total_seconds"  [attr-defined]

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ scheduler/tasks.py:104: error: Returning Any from function declared to return "float"  [no-any-return]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ tests/test_scalars.py:564: error: Expression is of type "datetime[None]", not "datetime[Any]"  [assert-type]
+ tests/test_scalars.py:623: error: Expression is of type "datetime[None]", not "datetime[Any]"  [assert-type]

ibis (https://github.com/ibis-project/ibis)
- ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
+ ibis/expr/types/temporal.py:800: error: Argument "right" to "TimestampDelta" has incompatible type "datetime[Any] | ibis.expr.types.generic.Value"; expected "ibis.expr.operations.core.Value[Timestamp, Any]"  [arg-type]
- ibis/backends/exasol/__init__.py:269: error: "datetime" has no attribute "tz_convert"  [attr-defined]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/json_util.py:925: error: Unused "type: ignore" comment  [unused-ignore]

discord.py (https://github.com/Rapptz/discord.py)
- discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/embeds.py:338: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[tzinfo]")  [assignment]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str) -> datetime[Any]
- discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/scheduled_event.py:155: note:     def parse_time(timestamp: str | None) -> datetime[Any] | None
- discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime
+ discord/member.py:155: note:     def parse_time(timestamp: str) -> datetime[Any]
- discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime | None
+ discord/member.py:155: note:     def parse_time(timestamp: str | None) -> datetime[Any] | None
- discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:207: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:209: error: Incompatible types in assignment (expression has type "datetime[tzinfo]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:217: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]
+ discord/ext/tasks/__init__.py:219: error: Incompatible types in assignment (expression has type "None", variable has type "datetime[Any]")  [assignment]
- discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:220: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:226: error: Unsupported operand types for >= ("datetime" and "None")  [operator]
+ discord/ext/tasks/__init__.py:226: error: No overload variant of "__ge__" of "datetime" matches argument type "None"  [operator]
+ discord/ext/tasks/__init__.py:226: note: Possible overload variants:
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[tzinfo] | datetime[tzinfo | None], /) -> bool
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[None] | datetime[tzinfo | None], /) -> bool
+ discord/ext/tasks/__init__.py:226: note:     def __ge__(self, datetime[Any], /) -> NoReturn
- discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:237: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:238: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:254: error: Argument 1 to "_try_sleep_until" of "Loop" has incompatible type "None"; expected "datetime[Any]"  [arg-type]
- discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime", variable has type "None")  [assignment]
+ discord/ext/tasks/__init__.py:762: error: Incompatible types in assignment (expression has type "datetime[Any]", variable has type "None")  [assignment]
- discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime"  [arg-type]
+ discord/ext/tasks/__init__.py:765: error: Argument 1 to "recalculate" of "SleepHandle" has incompatible type "None"; expected "datetime[Any]"  [arg-type]

koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/generic.py:93: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:95: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:105: error: Returning Any from function declared to return "bool"  [no-any-return]
+ koda_validate/generic.py:107: error: Returning Any from function declared to return "bool"  [no-any-return]

alerta (https://github.com/alerta/alerta)
- alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/key.py:24: error: Incompatible default for argument "expire_time" (default has type "None", argument has type "datetime[Any]")  [assignment]
- alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/key.py:54: error: Argument "expire_time" to "ApiKey" has incompatible type "datetime[Any] | None"; expected "datetime[Any]"  [arg-type]
- alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime")  [assignment]
+ alerta/models/heartbeat.py:28: error: Incompatible default for argument "create_time" (default has type "None", argument has type "datetime[Any]")  [assignment]
- alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime | None"; expected "datetime"  [arg-type]
+ alerta/models/heartbeat.py:88: error: Argument "create_time" to "Heartbeat" has incompatible type "datetime[Any] | None"; expected "datetime[Any]"  [arg-type]

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime | date | time | datetime64" due to an unfollowed import  [no-any-unimported]
+ src/bokeh/util/serialization.py:167:1: error: Argument 1 to "convert_datetime_type" becomes "Any | Any | Any | datetime[Any] | date | time | datetime64" due to an unfollowed import  [no-any-unimported]

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/config_option.py: note: In member "is_expired" of class "ConfigOption":
+ lib/streamlit/config_option.py:305:9: error: Returning Any from function declared to return "bool"  [no-any-return]
- lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:107:13: note:     def time_input(self, label: str, value: Union[time, datetime[Any], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
- lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime, Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time
+ lib/tests/streamlit/elements/time_input_test.py:138:13: note:     def time_input(self, label: str, value: Union[time, datetime[Any], Literal['now']] = ..., key: Optional[Union[str, int]] = ..., help: Optional[str] = ..., on_change: Optional[Callable[..., None]] = ..., args: Optional[Tuple[Any, ...]] = ..., kwargs: Optional[Dict[str, Any]] = ..., *, disabled: bool = ..., label_visibility: Literal['visible', 'hidden', 'collapsed'] = ..., step: Union[int, timedelta] = ...) -> time

github-actions[bot] avatar Apr 29 '24 14:04 github-actions[bot]

While I think there's some promise in this approach, I struggle with Any annotated datetimes. The __sub__ overloads (for example), derive a return type of Any, probably because mypy is merging the timedelta and NoReturn annotations of multiple annotations. Does anyone have an idea how to work around this?

srittau avatar Apr 29 '24 15:04 srittau

I don't have much to add except to say that having this will be truly great, my code is littered with "aware"/"not aware" comments which really should be in the type, so I hope you can get it to work. (I haven't been bothered with it enough to use something like DataType yet).

I am curious about two things:

  • Why default TzInfoT to Any instead of tzinfo | None?
  • Why are the overloads needed? I guess typecheckers don't know the type of default values so they don't see that fromtimestamp(123) is the same as fromtimestamp(123, tz=None) and so can't infer TzInfoT=None?

bluetech avatar May 15 '24 14:05 bluetech

@bluetech

  • Why default TzInfoT to Any instead of tzinfo | None?

It tried both, but both didn't work. tzinfo | None is also my preferred default, but I hoped that Any would have less problems when it didn't.

  • Why are the overloads needed? I guess typecheckers don't know the type of default values so they don't see that fromtimestamp(123) is the same as fromtimestamp(123, tz=None) and so can't infer TzInfoT=None?

Exactly.

srittau avatar May 19 '24 09:05 srittau