Skip to content
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

fix crash on invalid notebook files #1050

Merged
merged 1 commit into from
Feb 9, 2025
Merged

Conversation

DetachHead
Copy link
Owner

fixes #1048

@DetachHead DetachHead force-pushed the notebook-syntax-errors branch from cb75c0b to 986a544 Compare February 9, 2025 03:27

This comment has been minimized.

@DetachHead DetachHead force-pushed the notebook-syntax-errors branch from 986a544 to ba0bb46 Compare February 9, 2025 05:02
@DetachHead DetachHead enabled auto-merge (rebase) February 9, 2025 05:04

This comment has been minimized.

@DetachHead DetachHead force-pushed the notebook-syntax-errors branch from ba0bb46 to 37e23b0 Compare February 9, 2025 06:06
@DetachHead DetachHead merged commit 74d4721 into main Feb 9, 2025
20 checks passed
@DetachHead DetachHead deleted the notebook-syntax-errors branch February 9, 2025 06:29
Copy link
Contributor

github-actions bot commented Feb 9, 2025

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

sympy (https://github.com/sympy/sympy)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:10:46 - warning: Type of "igcd" is partially unknown
+     Type of "igcd" is "_lru_cache_wrapper[Unknown]" (reportUnknownVariableType)
-     Type of "factor_list" is "(f: Unknown, ...) -> Unknown" (reportUnknownVariableType)
+     Type of "factor_list" is "(f: Unknown, ...) -> (tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]])" (reportUnknownVariableType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
-     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Integer)" (reportUnknownMemberType)
+     Type of "expand" is "(deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Expr | Any | Self@Expr)" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:354:22 - warning: Argument type is unknown
+     Argument corresponds to parameter "object" in function "append" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:358:17 - warning: Type of "gcd" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:361:29 - warning: Argument type is unknown
+     Argument corresponds to parameter "object" in function "insert" (reportUnknownArgumentType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
-     Argument type is "Unknown | Expr | Any | Integer" (reportUnknownArgumentType)
+     Argument type is "Unknown | Expr | Any | Expr*" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:551:17 - warning: Type of "g" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:552:17 - warning: Type of "a" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:553:17 - warning: Type of "c" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:556:29 - warning: Argument type is unknown
+     Argument corresponds to parameter "n" in function "isqrt" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:557:29 - warning: Argument type is unknown
+     Argument corresponds to parameter "n" in function "isqrt" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:561:21 - warning: Type of "eq" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:562:43 - warning: Argument type is unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:567:33 - warning: Argument type is unknown
+     Argument corresponds to parameter "x" in function "int_valued" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:576:39 - warning: Argument type is unknown
+     Argument corresponds to parameter "a" in function "divisible" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:577:39 - warning: Argument type is unknown
+     Argument corresponds to parameter "a" in function "divisible" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:597:21 - warning: Type of "x_0" is partially unknown
+     Type of "x_0" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:598:21 - warning: Type of "y_0" is partially unknown
+     Type of "y_0" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:603:26 - warning: Type of "is_Integer" is partially unknown
+     Type of "is_Integer" is "bool | Unknown" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:603:45 - warning: Type of "is_Integer" is partially unknown
+     Type of "is_Integer" is "bool | Unknown" (reportUnknownMemberType)
-     Type of "equation" is "Unknown | Expr | Any | Integer" (reportUnknownMemberType)
+     Type of "equation" is "Unknown | Expr | Any | Self@Expr" (reportUnknownMemberType)
-     Argument type is "Unknown | Expr | Any | Integer" (reportUnknownArgumentType)
+     Argument type is "Unknown | Expr | Any | Expr*" (reportUnknownArgumentType)
-     Type of "x_n" is "Unknown | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | None" (reportUnknownVariableType)
+     Type of "x_n" is "Unknown | ComplexInfinity | Rational | None" (reportUnknownVariableType)
-     Type of "y_n" is "Unknown | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | None" (reportUnknownVariableType)
+     Type of "y_n" is "Unknown | ComplexInfinity | Rational | None" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:666:33 - warning: Type of "Xt" is partially unknown
+     Type of "Xt" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:667:33 - warning: Type of "Yt" is partially unknown
+     Type of "Yt" is "ComplexInfinity | Rational | Unknown" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1218:9 - warning: Type of "g" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1223:9 - warning: Type of "g" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1351:9 - warning: Type of "eq" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1351:9 - warning: Type of "eq" is partially unknown
+     Type of "eq" is "Unknown | Expr" (reportUnknownVariableType)
-     Type of "as_expr" is "(*gens: Unknown) -> Unknown" (reportUnknownMemberType)
+     Type of "as_expr" is "(*gens: Unknown) -> (Unknown | Expr)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1352:16 - warning: Type of "is_polynomial" is unknown (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1352:16 - warning: Type of "is_polynomial" is partially unknown
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1366:33 - warning: Argument type is unknown
-     Argument corresponds to parameter "eq" in function "classify_diop" (reportUnknownArgumentType)
-     Type of "terms" is "list[tuple[Unknown, int]]" (reportUnknownVariableType)
+     Type of "terms" is "list[tuple[Unknown | Expr, int]]" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1448:9 - warning: Type of "fl" is unknown (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1448:26 - warning: Argument type is unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1448:9 - warning: Type of "fl" is partially unknown
-     Argument corresponds to parameter "f" in function "factor_list" (reportUnknownArgumentType)
+     Type of "fl" is "tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | Rational | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1449:12 - warning: Type of "is_Rational" is unknown (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1449:12 - warning: Type of "is_Rational" is partially unknown
+     Type of "is_Rational" is "bool | Unknown | Any" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/diophantine/diophantine.py:1450:32 - warning: Argument type is unknown

... (truncated 3848 lines) ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore corrupted jupyter notebook files
1 participant