support pydantic#1505
Draft
KotlinIsland wants to merge 4 commits into
Draft
Conversation
4d79b5d to
3613bb3
Compare
This comment has been minimized.
This comment has been minimized.
3613bb3 to
8d3b40a
Compare
This comment has been minimized.
This comment has been minimized.
8d3b40a to
43808c2
Compare
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- Type of "set_mul" is "(x: Unknown, y: Unknown) -> (Any | Unknown | FiniteSet | ImageSet)" (reportUnknownVariableType)
+ Type of "set_mul" is "(x: Unknown, y: Unknown) -> (Any | Unknown | FiniteSet | ImageSet | Union)" (reportUnknownVariableType)
- .../projects/sympy/sympy/sets/handlers/mul.py:64:5 - warning: Return type, "Unknown | FiniteSet | Interval | Any | ImageSet", is partially unknown (reportUnknownParameterType)
+ .../projects/sympy/sympy/sets/handlers/mul.py:64:5 - warning: Return type, "Unknown | FiniteSet | Interval | Any | ImageSet | Union", is partially unknown (reportUnknownParameterType)
- .../projects/sympy/sympy/sets/handlers/mul.py:79:12 - warning: Return type, "Any | Unknown | FiniteSet | ImageSet", is partially unknown (reportUnknownVariableType)
+ .../projects/sympy/sympy/sets/handlers/mul.py:79:12 - warning: Return type, "Any | Unknown | FiniteSet | ImageSet | Union", is partially unknown (reportUnknownVariableType)
- Type of "set_div" is "(x: Unknown, y: Unknown) -> (Any | Unknown | FiniteSet | ImageSet)" (reportUnknownVariableType)
+ Type of "set_div" is "(x: Unknown, y: Unknown) -> (Any | Unknown | FiniteSet | ImageSet | Union)" (reportUnknownVariableType)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:143:5 - warning: Type of "S1" is partially unknown
- Type of "S1" is "Unknown | Basic | ImageSet | FiniteSet" (reportUnknownVariableType)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:144:12 - warning: Type of "base_pset" is partially unknown
- Type of "base_pset" is "Unknown | FiniteSet | ProductSet" (reportUnknownMemberType)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:144:15 - error: Cannot access attribute "base_pset" for class "Basic"
- Attribute "base_pset" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:144:15 - error: Cannot access attribute "base_pset" for class "FiniteSet"
- Attribute "base_pset" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:145:12 - warning: Type of "base_sets" is partially unknown
- Type of "base_sets" is "Unknown | Any" (reportUnknownMemberType)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:145:15 - error: Cannot access attribute "base_sets" for class "Basic"
- Attribute "base_sets" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/sets/tests/test_fancysets.py:145:15 - error: Cannot access attribute "base_sets" for class "FiniteSet"
- Attribute "base_sets" is unknown (reportAttributeAccessIssue)
- Type of "rootof" is "(f: Unknown, x: Unknown, index: Unknown | None = None, radicals: bool = True, expand: bool = True) -> (Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr)" (reportUnknownVariableType)
+ Type of "rootof" is "(f: Unknown, x: Unknown, index: Unknown | None = None, radicals: bool = True, expand: bool = True) -> (Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr)" (reportUnknownVariableType)
- Type of "nsimplify" is "(expr: Unknown, constants: Unknown = (), tolerance: Unknown | None = None, full: bool = False, rational: Unknown | None = None, rational_conversion: str = 'base10') -> (Integer | Unknown | NaN | ComplexInfinity | Rational | Zero | Infinity | NegativeInfinity | Float | Number | Expr)" (reportUnknownVariableType)
+ Type of "nsimplify" is "(expr: Unknown, constants: Unknown = (), tolerance: Unknown | None = None, full: bool = False, rational: Unknown | None = None, rational_conversion: str = 'base10') -> (Integer | Unknown | NaN | ComplexInfinity | Rational | Zero | Infinity | NegativeInfinity | Float | Number | Expr | One | NegativeOne)" (reportUnknownVariableType)
- Type of "fu" is "(rv: Unknown, measure: Unknown = lambda x: (L(x), x.count_ops())) -> (Unknown | Expr | ComplexInfinity | NaN | Rational)" (reportUnknownVariableType)
+ Type of "fu" is "(rv: Unknown, measure: Unknown = lambda x: (L(x), x.count_ops())) -> (Unknown | Expr | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
- Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> (Unknown | Expr | Mul | Add | None)" (reportUnknownVariableType)
+ Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> (Unknown | Expr | Any | Mul | Add | None)" (reportUnknownVariableType)
- Type of "fraction" is "(expr: Unknown, exact: bool = False) -> Unknown" (reportUnknownVariableType)
+ Type of "fraction" is "(expr: Unknown, exact: bool = False) -> tuple[Expr, Expr]" (reportUnknownVariableType)
- Type of "numer" is "(expr: Unknown, exact: bool = False) -> Unknown" (reportUnknownVariableType)
+ Type of "numer" is "(expr: Unknown, exact: bool = False) -> Expr" (reportUnknownVariableType)
- Type of "denom" is "(expr: Unknown, exact: bool = False) -> Unknown" (reportUnknownVariableType)
+ Type of "denom" is "(expr: Unknown, exact: bool = False) -> Expr" (reportUnknownVariableType)
- Type of "trigsimp" is "(expr: Unknown, inverse: bool = False, **opts: Unknown) -> (Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational)" (reportUnknownVariableType)
+ Type of "trigsimp" is "(expr: Unknown, inverse: bool = False, **opts: Unknown) -> (Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
- .../projects/sympy/sympy/simplify/fu.py:41:5 - warning: Return type, "ComplexInfinity | NaN | Rational | Unknown", is partially unknown (reportUnknownParameterType)
+ .../projects/sympy/sympy/simplify/fu.py:41:5 - warning: Return type, "ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | Unknown", is partially unknown (reportUnknownParameterType)
- .../projects/sympy/sympy/simplify/fu.py:53:9 - warning: Return type, "ComplexInfinity | NaN | Rational | Unknown", is partially unknown (reportUnknownParameterType)
+ .../projects/sympy/sympy/simplify/fu.py:53:9 - warning: Return type, "ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | Unknown", is partially unknown (reportUnknownParameterType)
- .../projects/sympy/sympy/simplify/fu.py:56:20 - warning: Return type, "ComplexInfinity | NaN | Rational | Unknown", is partially unknown (reportUnknownVariableType)
- .../projects/sympy/sympy/simplify/fu.py:59:20 - warning: Return type, "ComplexInfinity | NaN | Rational | Unknown", is partially unknown (reportUnknownVariableType)
- .../projects/sympy/sympy/simplify/fu.py:62:12 - warning: Return type, "ComplexInfinity | NaN | Rational | Unknown", is partially unknown (reportUnknownVariableType)
+ .../projects/sympy/sympy/simplify/fu.py:62:12 - warning: Return type, "ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | Unknown", is partially unknown (reportUnknownVariableType)
- .../projects/sympy/sympy/simplify/fu.py:1480:5 - warning: Return type, "Unknown | Pow | Expr | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownParameterType)
+ .../projects/sympy/sympy/simplify/fu.py:1480:5 - warning: Return type, "Unknown | Pow | Expr | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | _NotImplementedType", is partially unknown (reportUnknownParameterType)
- .../projects/sympy/sympy/simplify/fu.py:1501:9 - warning: Return type, "Unknown | Pow | Expr | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownParameterType)
+ .../projects/sympy/sympy/simplify/fu.py:1501:9 - warning: Return type, "Unknown | Pow | Expr | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | _NotImplementedType", is partially unknown (reportUnknownParameterType)
- .../projects/sympy/sympy/simplify/fu.py:1511:17 - warning: Type of "rv" is partially unknown
- Type of "rv" is "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Expr" (reportUnknownVariableType)
- .../projects/sympy/sympy/simplify/fu.py:1511:61 - warning: Argument type is partially unknown
- Argument type is "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Expr" (reportUnknownArgumentType)
- .../projects/sympy/sympy/simplify/fu.py:1517:17 - warning: Type of "rv" is partially unknown
- Type of "rv" is "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Expr" (reportUnknownVariableType)
- .../projects/sympy/sympy/simplify/fu.py:1517:57 - warning: Argument type is partially unknown
- Argument type is "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Expr" (reportUnknownArgumentType)
- .../projects/sympy/sympy/simplify/fu.py:1521:16 - warning: Return type, "Expr | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Unknown | Pow", is partially unknown (reportUnknownVariableType)
+ .../projects/sympy/sympy/simplify/fu.py:1521:16 - warning: Return type, "Expr | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Unknown | _NotImplementedType | Pow", is partially unknown (reportUnknownVariableType)
... (truncated 5155 lines) ...
prefect (https://github.com/PrefectHQ/prefect)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_v2.py:37:15 - error: Arguments missing for parameters "deleteTime", "expireTime", "creator", "lastModifier", "client", "clientVersion", "observedGeneration" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_v2.py:58:15 - error: Arguments missing for parameters "deleteTime", "expireTime", "creator", "lastModifier", "client", "clientVersion", "observedGeneration" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_v2.py:102:15 - error: Arguments missing for parameters "deleteTime", "expireTime", "creator", "lastModifier", "client", "clientVersion", "observedGeneration" (reportCallIssue)
+ .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_v2.py:109:31 - warning: Argument type is unknown
+ Argument corresponds to parameter "terminalCondition" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_v2.py:137:15 - error: Arguments missing for parameters "deleteTime", "expireTime", "creator", "lastModifier", "client", "clientVersion", "observedGeneration" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_worker.py:490:22 - error: Arguments missing for parameters "pull_steps", "work_queue_name", "storage_document_id", "infrastructure_document_id", "description", "path", "version", "entrypoint" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_worker.py:504:22 - error: Arguments missing for parameters "pull_steps", "work_queue_name", "storage_document_id", "infrastructure_document_id", "description", "path", "version", "entrypoint" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_worker.py:515:22 - error: Arguments missing for parameters "pull_steps", "work_queue_name", "storage_document_id", "infrastructure_document_id", "description", "path", "version", "entrypoint" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-gcp/tests/test_cloud_run_worker.py:528:22 - error: Arguments missing for parameters "pull_steps", "work_queue_name", "storage_document_id", "infrastructure_document_id", "description", "path", "version", "entrypoint" (reportCallIssue)
- Extra parameter "account"
- Extra parameter "user"
+ "EllipsisType" is not assignable to "str"
+ "EllipsisType" is not assignable to "str"
- Extra parameter "account"
- Extra parameter "user" (reportArgumentType)
+ "EllipsisType" is not assignable to "str"
+ "EllipsisType" is not assignable to "str" (reportArgumentType)
- Extra parameter "account"
- Extra parameter "user"
+ "EllipsisType" is not assignable to "str"
+ "EllipsisType" is not assignable to "str"
- Extra parameter "account"
- Extra parameter "user" (reportArgumentType)
+ "EllipsisType" is not assignable to "str"
+ "EllipsisType" is not assignable to "str" (reportArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_credentials.py:351:13 - error: No parameter named "schema" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_credentials.py:381:13 - error: No parameter named "schema" (reportCallIssue)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "credentials" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "database" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "warehouse" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "schema_" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "fetch_size" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "poll_frequency_s" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "_connection" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:54:48 - warning: Argument type is unknown
- Argument corresponds to parameter "_unique_cursors" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "credentials" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "database" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "warehouse" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "schema_" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "fetch_size" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "poll_frequency_s" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "_connection" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:67:48 - warning: Argument type is unknown
- Argument corresponds to parameter "_unique_cursors" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "credentials" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "database" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "warehouse" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "schema_" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "fetch_size" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "poll_frequency_s" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "_connection" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:74:48 - warning: Argument type is unknown
- Argument corresponds to parameter "_unique_cursors" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:208:48 - warning: Argument type is unknown
- Argument corresponds to parameter "credentials" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:208:48 - warning: Argument type is unknown
- Argument corresponds to parameter "database" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:208:48 - warning: Argument type is unknown
- Argument corresponds to parameter "warehouse" in function "__init__" (reportUnknownArgumentType)
- .../projects/prefect/src/integrations/prefect-snowflake/tests/test_database.py:208:48 - warning: Argument type is unknown
- Argument corresponds to parameter "schema_" in function "__init__" (reportUnknownArgumentType)
... (truncated 69 lines) ...
pyodide (https://github.com/pyodide/pyodide)
- .../projects/pyodide/pyodide-build/pyodide_build/recipe/spec.py:151:25 - error: Arguments missing for parameters "backend-flags", "type", "cross-script", "unvendor-tests", "_retain-test-patterns", "vendor-sharedlib", "cross-build-env", "cross-build-files" (reportCallIssue)
- .../projects/pyodide/pyodide-build/pyodide_build/recipe/spec.py:155:25 - error: Argument missing for parameter "recipe-maintainers" (reportCallIssue)
- .../projects/pyodide/pyodide-build/pyodide_build/tests/recipe/test_spec.py:48:9 - error: Arguments missing for parameters "backend-flags", "cross-script", "unvendor-tests", "_retain-test-patterns", "vendor-sharedlib", "cross-build-env", "cross-build-files" (reportCallIssue)
- 1079 errors, 11659 warnings, 0 notes
+ 1076 errors, 11659 warnings, 0 notes
artigraph (https://github.com/artigraph/artigraph)
- .../projects/artigraph/src/arti/storage/__init__.py:221:15 - error: Argument of type "str | Any" cannot be assigned to parameter "_arti_fingerprint_fields_" of type "tuple[str, ...]" in function "__init__"
- Type "str | Any" is not assignable to type "tuple[str, ...]"
- "str" is not assignable to "tuple[str, ...]" (reportArgumentType)
- .../projects/artigraph/src/arti/views/__init__.py:112:40 - warning: Argument type is Any
- Argument corresponds to parameter "_arti_fingerprint_fields_" in function "__init__" (reportAny)
- 370 errors, 2641 warnings, 0 notes
+ 369 errors, 2640 warnings, 0 notes
|
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
part of #868