-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed override-related checks (reportIncompatibleMethodOverride
, …
#6159
Conversation
…`reportIncompatibleVariableOverride` and `reportImplicitOverride`) so they apply to stub files. Previously, these were skipped for stubs. This addresses #6158.
Diff from mypy_primer, showing the effect of this PR on open source code: pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timedeltas.pyi:104:5 - error: "min" overrides symbol of same name in class "timedelta"
+ Variable is mutable so its type is invariant
+ Override type "Timedelta" is not the same as base type "timedelta" (reportIncompatibleVariableOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timedeltas.pyi:105:5 - error: "max" overrides symbol of same name in class "timedelta"
+ Variable is mutable so its type is invariant
+ Override type "Timedelta" is not the same as base type "timedelta" (reportIncompatibleVariableOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timedeltas.pyi:106:5 - error: "resolution" overrides symbol of same name in class "timedelta"
+ Variable is mutable so its type is invariant
+ Override type "Timedelta" is not the same as base type "timedelta" (reportIncompatibleVariableOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:50:5 - error: "min" overrides symbol of same name in class "datetime"
+ Variable is mutable so its type is invariant
+ Override type "Timestamp" is not the same as base type "datetime" (reportIncompatibleVariableOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:51:5 - error: "max" overrides symbol of same name in class "datetime"
+ Variable is mutable so its type is invariant
+ Override type "Timestamp" is not the same as base type "datetime" (reportIncompatibleVariableOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:53:5 - error: "resolution" overrides symbol of same name in class "date"
+ Variable is mutable so its type is invariant
+ Override type "Timedelta" is not the same as base type "timedelta" (reportIncompatibleVariableOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:120:9 - error: Method "combine" overrides class "datetime" in an incompatible manner
+ Positional parameter count mismatch; base method has 4, but override has 3
+ Return type mismatch: base method returns type "Timestamp", override returns type "datetime"
+ "datetime" is incompatible with "Timestamp" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:135:9 - error: Method "replace" overrides class "datetime" in an incompatible manner
+ Parameter 2 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter 3 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter 4 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter 5 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter 6 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter 7 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter 8 type mismatch: base parameter is type "SupportsIndex", override parameter is type "int | None"
+ Parameter "fold" is missing in override
+ ... (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:151:9 - error: Method "strptime" overrides class "datetime" in an incompatible manner
+ Parameter 2 type mismatch: base parameter is type "str", override parameter is type "Never"
+ Parameter 3 type mismatch: base parameter is type "str", override parameter is type "Never"
+ Type "str" cannot be assigned to type "Never"
+ Type "str" cannot be assigned to type "Never" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/_libs/tslibs/timestamps.pyi:210:9 - error: Method "__sub__" overrides class "datetime" in an incompatible manner
+ Override does not handle all overloads of base method (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/arraylike.pyi
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/arraylike.pyi:10:9 - error: Method "__eq__" overrides class "object" in an incompatible manner
+ Return type mismatch: base method returns type "bool", override returns type "Self@OpsMixin"
+ "OpsMixin" is incompatible with "bool" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/arraylike.pyi:11:9 - error: Method "__ne__" overrides class "object" in an incompatible manner
+ Return type mismatch: base method returns type "bool", override returns type "Self@OpsMixin"
+ "OpsMixin" is incompatible with "bool" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/generic.pyi:57:5 - error: "__hash__" overrides method of same name in class "object" with incompatible type "None" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1448:9 - error: "T" incorrectly overrides property of same name in class "IndexOpsMixin"
+ Property method "fget" is incompatible
+ Return type mismatch: base method returns type "Self@IndexOpsMixin[S1@IndexOpsMixin]", override returns type "Series[S1@Series]"
+ "Series[S1@Series]" is incompatible with "IndexOpsMixin[S1@IndexOpsMixin]"
+ Type parameter "S1@IndexOpsMixin" is invariant, but "S1@Series" is not the same as "S1@IndexOpsMixin" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1466:9 - error: Method "__and__" overrides class "OpsMixin" in an incompatible manner
+ No overload signature in override is compatible with base method (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1469:9 - error: Method "__eq__" overrides class "OpsMixin" in an incompatible manner
+ Return type mismatch: base method returns type "Series[S1@Series]", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "Series[S1@Series]"
+ Type parameter "S1@Series" is invariant, but "_bool" is not the same as "S1@Series" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1469:9 - error: Method "__eq__" overrides class "object" in an incompatible manner
+ Return type mismatch: base method returns type "bool", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "bool" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1471:9 - error: Method "__ge__" overrides class "OpsMixin" in an incompatible manner
+ Return type mismatch: base method returns type "Series[S1@Series]", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "Series[S1@Series]"
+ Type parameter "S1@Series" is invariant, but "_bool" is not the same as "S1@Series" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1474:9 - error: Method "__gt__" overrides class "OpsMixin" in an incompatible manner
+ Return type mismatch: base method returns type "Series[S1@Series]", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "Series[S1@Series]"
+ Type parameter "S1@Series" is invariant, but "_bool" is not the same as "S1@Series" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1477:9 - error: Method "__le__" overrides class "OpsMixin" in an incompatible manner
+ Return type mismatch: base method returns type "Series[S1@Series]", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "Series[S1@Series]"
+ Type parameter "S1@Series" is invariant, but "_bool" is not the same as "S1@Series" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1480:9 - error: Method "__lt__" overrides class "OpsMixin" in an incompatible manner
+ Return type mismatch: base method returns type "Series[S1@Series]", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "Series[S1@Series]"
+ Type parameter "S1@Series" is invariant, but "_bool" is not the same as "S1@Series" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1490:9 - error: Method "__ne__" overrides class "OpsMixin" in an incompatible manner
+ Return type mismatch: base method returns type "Series[S1@Series]", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "Series[S1@Series]"
+ Type parameter "S1@Series" is invariant, but "_bool" is not the same as "S1@Series" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1490:9 - error: Method "__ne__" overrides class "object" in an incompatible manner
+ Return type mismatch: base method returns type "bool", override returns type "Series[_bool]"
+ "Series[_bool]" is incompatible with "bool" (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1498:9 - error: Method "__or__" overrides class "OpsMixin" in an incompatible manner
+ No overload signature in override is compatible with base method (reportIncompatibleMethodOverride)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/series.pyi:1509:9 - error: Method "__rand__" overrides class "OpsMixin" in an incompatible manner
... (truncated 164 lines) ...
|
Thanks. We had |
…
reportIncompatibleVariableOverride
andreportImplicitOverride
) so they apply to stub files. Previously, these were skipped for stubs. This addresses #6158.