Skip to content

Preserve container types for ambiguous overload returns - #11732

Merged
Rich Chiodo (rchiodo) merged 6 commits into
mainfrom
rchiodo-specialized-self-regression
Sep 10, 2026
Merged

Rich Chiodo (rchiodo) merged 6 commits into
mainfrom
rchiodo-specialized-self-regression

Conversation

@rchiodo

@rchiodo Rich Chiodo (rchiodo) commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Addresses #11731. Fixes the reported shared-container regression and the related Spark timedelta-operation regression. Also adds advisory explanations of mypy_primer differences for future PRs. The broader historical pandas-stubs differences are not all resolved.

  • Preserve shared generic return structure when nested Any or Unknown makes overload resolution ambiguous, including specialized self parameters and inferred constructors. Container[Any].copy() retains its container type and nonexistent-member diagnostics.
  • Preserve correlated protocol type-variable solutions when binding methods, rather than discarding every signature after the first. Spark's (Timestamp - Series[Any]) // np.timedelta64(...) - 1 now resolves to Series[int] instead of reporting an unsupported operation.
  • Keep ordinary protocol argument inference and existing first-signature fallbacks unchanged. Newly recognized bound alternatives cannot hide later declared overloads when receiver ambiguity is unresolved.
  • Add a separate, advisory agentic workflow that explains the complete mypy_primer output without replacing the existing raw comment or automatically approving a PR.

Precision rationale

Classification B: Pyright inference limitation; no typeshed changes.

python/typing#2350 permits more precise gradual overload results that satisfy both assignability and supported-operation requirements. The container merge recursively retains compatible generic arguments and tuple shapes, and verifies assignability to every retained return type. Unsupported shapes, differing non-invariant arguments, incompatible nominal families, and mixtures with Never retain conservative fallbacks.

The Spark follow-up is intentionally limited to protocol-annotated method binding. An experimental broader change affected existing precise expectations and was discarded. Existing Pyright expectations remain unchanged by the Spark follow-up; no assertions or diagnostic expectations were weakened to hide failures.

Reviewed precision changes in pandas-stubs

On unchanged pandas-stubs commit 507243e3c1c1f0a6d92b5c409684fd691e2d6980, the Spark correction introduces these four assertion differences relative to the initial container fix:

Test Lines Before After
tests/series/test_floordiv.py 47, 64, 107 Series[Timedelta] Series[Any]
tests/indexes/test_floordiv.py 47 TimedeltaIndex Any

These receivers are annotated with Any. Dividing a timedelta by a numeric container can produce timedeltas, whereas dividing it by a timedelta container can produce integers. Recognizing the additional valid specialization makes the old timedelta-only result unjustified. The Series alternatives retain their common container; the Index alternatives have different nominal families and use the conservative Any fallback. Concrete numeric receivers retain their precise timedelta results.

These changes were explicitly reviewed and accepted. The mitigation is a narrowly scoped inference change, correlated-return and mixed-overload regression coverage, and this explicit compatibility report; the external expectations were not rewritten. Another 24 ignore directives become unnecessary because the newly supported operations on gradual receivers no longer produce their former errors.

The complete local 356-file corpus comparison is:

Version Assertion failures Total errors Warnings
Published Pyright 1.1.414 240 442 3
Initial container fix 19 221 3
Container fix plus scoped Spark correction 23 249 3

The final increase of 28 relative to the initial fix is exactly the four reviewed assertion changes and 24 unnecessary-ignore diagnostics. Other diagnostic-category counts are unchanged. Totals include unrelated dependency/environment diagnostics and are not a count of checker regressions.

Remaining historical differences

The original 19 assertion differences remain. All 19 passed in 1.1.411 and already failed in 1.1.412. Restoring those old types is not necessarily valid under the current overload specification, particularly for candidates with incompatible nominal families or mixtures involving Never; this PR does not resolve that broader work.

The other six Spark diagnostics previously investigated exposed existing literal-argument, stub, narrowing, or decorator-inference limitations rather than the timedelta operation-preservation defect. This PR does not claim to eliminate all Spark or SymPy differences. The new CI primer run must be reviewed independently; historical comparisons do not establish that every new diagnostic is expected.

Advisory mypy_primer workflow

The existing trusted raw-comment workflow hands off the upstream run identity. Deterministic preparation validates the run, attempt, complete eight-shard inventory, PR association, and current head, then counts diagnostic records for every changed project. Copilot reads the evidence with no shell, editing tools, or PR checkout. A separate publisher requires successful threat detection, validates project coverage, rechecks the head, and posts an explanatory table plus a complete report artifact.

The report distinguishes expected improvements, exposed typing limitations, possible regressions, and cases needing human review. It does not approve PRs, change labels, merge changes, or fail CI merely because diagnostics differ. The existing raw comment is preserved.

Activation requires merging the workflow into main and repository access to organization-billed Copilot inference. It will not automatically analyze this PR before landing. Limits are 25 AI credits, 30 turns, and 15 minutes. See docs/mypy-primer-analysis.md for maintenance, provenance limits, and the guarded staged-publication path.

Validation

  • Core TypeScript build and final development CLI build.
  • Final typeEvaluator6, typeUtils, and mypyPrimerAnalysis suites: 184 passing cases.
  • Related overload, protocol, method, Self, ParamSpec, and constructor selection: 205 passing cases.
  • Exact pinned Spark datetime reproduction resolves to Series[int]; the deliberately invalid concrete timestamp-division case remains rejected.
  • Full pinned pandas-stubs corpus comparison described above.
  • Agentic workflow compiled and validated with gh aw v0.86.2. Trusted staged activation handling was exercised; the checked-in lock is production/non-staged.
  • Existing primer artifacts exercised through a read-only staged path with GitHub writes prohibited. No live AI workflow or analysis comment was run.
  • Targeted ESLint, authored-code Prettier checks, and git diff --check.

Address #11731 by retaining shared generic structure for nested Any and Unknown overload ambiguity, including specialized self and inferred constructors. Keep conservative fallbacks for unsupported shapes and differing non-invariant type arguments.

Classification B: Pyright inference limitation. No typeshed change. Following python/typing#2350, replace top-level gradual results with assignable gradual containers where supported; preserve existing concrete precision and assert missing-member diagnostics.

Co-authored-by: Copilot App <[email protected]>
@bschnurr

Bill Schnurr (bschnurr) commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

@github-actions

This comment has been minimized.

@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Summary: Targeted overload evaluator tests could not run because the offline cache lacked the baseline `[email protected]` tarball. Consequently, the package-local Jest runner was unavailable. The PR adds substantial regression coverage, but no meaningful tests executed, so confidence is low.

Test runs: 1 passed, 2 not run

  • ⚠️ Not run | Targeted overload materialization evaluator tests | node ./node_modules/jest/bin/jest.js src/tests/typeEvaluator6.test.ts --runInBand --testNamePattern='OverloadCall(6|11|12|13)$'
  • ⚠️ Not run | Offline dependency bootstrap | pnpm install --offline --frozen-lockfile
  • ✅ Passed | Dependency and test-runner discovery | printf 'sandbox_profile=%s\n' "${AUTOMATION_SANDBOX_PROFILE:-}"; printf '%s\n' '--- changed files ---'; git diff --name-status HEAD~1...HEAD; printf '%s\n' '--- tool/dependency availability ---'; node --version; pnpm --version; if [ -x packages/pyright-internal/node_modules/.bin/jest ]; then echo 'package-local jest: present'; else echo 'package-local jest: missing'; fi; if [ -f pnpm-lock.yaml ]; then echo 'pnpm lockfile: present'; else echo 'pnpm lockfile: missing'; fi
⚠️ Targeted overload materialization evaluator tests diagnostic output
Error: Cannot find module '/workspace/packages/pyright-internal/node_modules/jest/bin/jest.js'
⚠️ Offline dependency bootstrap diagnostic output
[ERR_PNPM_NO_OFFLINE_TARBALL] A package is missing from the store: js-yaml-4.1.1.tgz.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:changes-requested Automated review: posted blocking findings to address. label Sep 10, 2026
Classification B: Pyright inference limitation; no typeshed changes. Preserve correlated protocol self signatures and the Spark Series[int] result, while retaining legacy inference outside newly recognized alternatives.

The four reviewed pandas-stubs precision changes are documented in PR #11732: the old timedelta-only results excluded valid integer results.

Co-authored-by: Copilot App <[email protected]>
Analyze all eight primer shards using trusted preparation, read-only Copilot analysis, and separately validated publication. Preserve raw primer comments and activate the workflow after it lands on main.

Co-authored-by: Copilot App <[email protected]>
@github-actions

This comment has been minimized.

Apply Prettier's full-file formatting to the new assertion; no type expectations or behavior change.

Co-authored-by: Copilot App <[email protected]>
@bschnurr

Copy link
Copy Markdown
Member

/benchmark

@github-actions

This comment has been minimized.

@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: Isolated verification observed failures whose relationship to this PR could not be determined: Offline dependency bootstrap; this review is not fully verified.

Summary: No meaningful tests ran. Offline dependency installation failed because `js-yaml-4.1.1` was absent from the sandbox cache, leaving the package-local Jest runner unavailable. One Jest attempt also encountered a verification-environment file-lock error. The PR adds substantial targeted coverage, but execution could not be verified.

Test runs: 1 passed, 1 failed, 2 not run

  • ⚠️ Not run | mypy_primer analysis Jest suite | node ./node_modules/jest/bin/jest.js src/tests/mypyPrimerAnalysis.test.ts --runInBand
  • ⚠️ Not run | OverloadCall11-14 targeted evaluator tests | node ./node_modules/jest/bin/jest.js src/tests/typeEvaluator6.test.ts --runInBand --testNamePattern='OverloadCall(11|12|13|14)'
  • ❌ Failed | relationship unknown | Offline dependency bootstrap | pnpm install --offline --frozen-lockfile
  • ✅ Passed | Dependency and test discovery | printf 'AUTOMATION_SANDBOX_PROFILE=%s\n' "${AUTOMATION_SANDBOX_PROFILE:-}"; printf 'node='; node --version; printf 'pnpm='; pnpm --version; if [ -d node_modules ] && [ -d packages/pyright-internal/node_modules ]; then echo 'dependencies=present'; else echo 'dependencies=missing'; fi; base=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || true); echo "merge_base=$base"; if [ -n "$base" ]; then git diff --name-status "$base"..HEAD; else git show --name-status --format= HEAD; fi; printf '\nChanged/new test declarations:\n'; grep -nE "^(describe|test)(" packages/pyright-internal/src/tests/mypyPrimerAnalysis.test.ts packages/pyright-internal/src/tests/typeEvaluator6.test.ts packages/pyright-internal/src/tests/typeUtils.test.ts | grep -E 'mypyPrimerAnalysis|OverloadCall1[34]|Map signatures'
⚠️ mypy_primer analysis Jest suite diagnostic output
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process
⚠️ OverloadCall11-14 targeted evaluator tests diagnostic output
Error: Cannot find module '/workspace/packages/pyright-internal/node_modules/jest/bin/jest.js'
Node.js v24.15.0
❌ Offline dependency bootstrap diagnostic output
Progress: resolved 1062, reused 1059
[ERR_PNPM_NO_OFFLINE_TARBALL] A package is missing from the store: js-yaml-4.1.1.tgz

@github-actions

This comment has been minimized.

@rchiodo

Copy link
Copy Markdown
Collaborator Author

Addressed all three assertion comments in 9491918 and replied in the individual threads.

For the separate could-not-verify report, I could run the affected tests here using the existing installed dependencies; no dependency changes were needed:

  • pnpm --dir packages/pyright-internal exec jest typeEvaluator6.test mypyPrimerAnalysis.test --testNamePattern 'OverloadCall(13|14)$|mypy_primer analysis' --runInBand --forceExit: 25 passed (the two overload regression cases and all 23 primer-analysis cases).
  • pnpm run check: passed the repository syncpack, ESLint, and full-file Prettier checks.

This commit strengthens assertions only; it does not change checker or workflow behavior.

@github-actions

This comment has been minimized.

@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Summary: The targeted suites cover overload inference, protocol-bound signatures, and the new mypy_primer workflow. Verification could not execute because `pnpm install --offline --frozen-lockfile` lacked the cached `js-yaml-4.1.1` tarball, leaving Jest unavailable. All three targeted commands consequently stopped with `MODULE_NOT_FOUND` before collecting tests. No meaningful test ran, so the verdict is **could-not-verify**.

Test runs: 4 not run

  • ⚠️ Not run | Offline dependency bootstrap | pnpm install --offline --frozen-lockfile
  • ⚠️ Not run | typeEvaluator6 targeted suite | node ./node_modules/jest/bin/jest.js src/tests/typeEvaluator6.test.ts --runInBand
  • ⚠️ Not run | typeUtils targeted suite | node ./node_modules/jest/bin/jest.js src/tests/typeUtils.test.ts --runInBand
  • ⚠️ Not run | mypyPrimerAnalysis targeted suite | node ./node_modules/jest/bin/jest.js src/tests/mypyPrimerAnalysis.test.ts --runInBand
⚠️ Offline dependency bootstrap diagnostic output
[ERR_PNPM_NO_OFFLINE_TARBALL] A package is missing from the store but cannot download it in offline mode: js-yaml-4.1.1.tgz.
⚠️ typeEvaluator6 targeted suite diagnostic output
Error: Cannot find module '/workspace/packages/pyright-internal/node_modules/jest/bin/jest.js'
Node.js v24.15.0
⚠️ typeUtils targeted suite diagnostic output
Error: Cannot find module '/workspace/packages/pyright-internal/node_modules/jest/bin/jest.js'
Node.js v24.15.0
⚠️ mypyPrimerAnalysis targeted suite diagnostic output
Error: Cannot find module '/workspace/packages/pyright-internal/node_modules/jest/bin/jest.js'
Node.js v24.15.0

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. labels Sep 10, 2026
Preserve headerless diagnostic details as separate evidence and counts, require their analysis, and regenerate the agentic workflow.

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

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

sympy (https://github.com/sympy/sympy)
+   .../projects/sympy/sympy/solvers/ode/nonhomogeneous.py:225:45 - error: Cannot access attribute "has" for class "tuple[Expr, int]"
+     Attribute "has" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/ode/nonhomogeneous.py:223:22 - error: No overloads for "__new__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/ode/nonhomogeneous.py:223:25 - error: Argument of type "Unknown | One | NegativeOne | Zero | Integer | tuple[Expr, int]" cannot be assigned to parameter "arg" of type "Expr" in function "__new__"
-     Type "Unknown | One | NegativeOne | Zero | Integer | tuple[Expr, int]" is not assignable to type "Expr"
-       "tuple[Expr, int]" is not assignable to "Expr" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/ode/nonhomogeneous.py:238:40 - error: No overloads for "__new__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/ode/nonhomogeneous.py:238:50 - error: Argument of type "Unknown | One | NegativeOne | Zero | Integer | tuple[Expr, int]" cannot be assigned to parameter "arg" of type "Expr" in function "__new__"
-     Type "Unknown | One | NegativeOne | Zero | Integer | tuple[Expr, int]" is not assignable to type "Expr"
-       "tuple[Expr, int]" is not assignable to "Expr" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/ode/ode.py:1433:17 - error: Argument of type "One | NegativeOne | Zero | Integer | Unknown | Rational | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
+   .../projects/sympy/sympy/solvers/ode/ode.py:1433:17 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
-     Type "One | NegativeOne | Zero | Integer | Unknown | Rational | Number | Expr" is not assignable to type "Zero"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "Zero"
-   .../projects/sympy/sympy/solvers/ode/ode.py:2961:17 - error: Argument of type "One | NegativeOne | Zero | Integer | Unknown | Rational | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
+   .../projects/sympy/sympy/solvers/ode/ode.py:2961:17 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
-     Type "One | NegativeOne | Zero | Integer | Unknown | Rational | Number | Expr" is not assignable to type "Zero"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "Zero"
-   .../projects/sympy/sympy/solvers/ode/single.py:867:9 - error: Expression with type "tuple[ComplexInfinity | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" cannot be assigned to target tuple
+   .../projects/sympy/sympy/solvers/ode/single.py:867:9 - error: Expression with type "tuple[ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" cannot be assigned to target tuple
-     Type "tuple[ComplexInfinity | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" is incompatible with target tuple
+     Type "tuple[ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" is incompatible with target tuple
-   .../projects/sympy/sympy/solvers/ode/single.py:2375:23 - error: Argument of type "dict[str, Equality | BooleanFalse | BooleanTrue | bool | list[Unknown]]" cannot be assigned to parameter "m" of type "Iterable[tuple[int, Unknown | One | NegativeOne | Zero | Integer | Expr]]" in function "update"
+   .../projects/sympy/sympy/solvers/ode/single.py:2375:23 - error: Argument of type "dict[str, Equality | BooleanFalse | BooleanTrue | bool | list[Unknown]]" cannot be assigned to parameter "m" of type "Iterable[tuple[int, Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr]]" in function "update"
-     "Literal['list']" is not assignable to "tuple[int, Unknown | One | NegativeOne | Zero | Integer | Expr]"
+     "Literal['list']" is not assignable to "tuple[int, Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr]"
-     "Literal['sol']" is not assignable to "tuple[int, Unknown | One | NegativeOne | Zero | Integer | Expr]"
+     "Literal['sol']" is not assignable to "tuple[int, Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr]"
-     "Literal['simpliy_flag']" is not assignable to "tuple[int, Unknown | One | NegativeOne | Zero | Integer | Expr]" (reportArgumentType)
+     "Literal['simpliy_flag']" is not assignable to "tuple[int, Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr]" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/ode/single.py:2646:27 - error: Argument of type "One | NegativeOne | Zero | Integer | Unknown | Rational | Number | Expr | NaN | NegativeInfinity | int" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
+   .../projects/sympy/sympy/solvers/ode/single.py:2646:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr | Unknown | int" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
-     Type "One | NegativeOne | Zero | Integer | Unknown | Rational | Number | Expr | NaN | NegativeInfinity | int" is not assignable to type "SupportsIndex"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr | Unknown | int" is not assignable to type "SupportsIndex"
+   .../projects/sympy/sympy/solvers/recurr.py:249:33 - error: Operator "*" not supported for types "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | NotImplementedType | Expr" and "Basic | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | Unknown"
+     Operator "*" not supported for types "ComplexInfinity" and "Basic"
+     Operator "*" not supported for types "Expr" and "Basic" (reportOperatorIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:240:17 - error: No overloads for "__setitem__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:240:17 - error: Argument of type "ComplexInfinity | Unknown" cannot be assigned to parameter "value" of type "One" in function "__setitem__"
-     Type "ComplexInfinity | Unknown" is not assignable to type "One"
-       "ComplexInfinity" is not assignable to "One" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/recurr.py:313:18 - error: Operator "+" not supported for types "Expr" and "Basic | One | NegativeOne | Zero | Integer | Unknown | Expr"
+   .../projects/sympy/sympy/solvers/recurr.py:313:18 - error: Operator "+" not supported for types "Expr" and "Basic | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | Unknown"
-   .../projects/sympy/sympy/solvers/recurr.py:442:23 - error: Argument of type "Unknown | Basic" cannot be assigned to parameter "args" of type "Expr | complex" in function "__new__"
+   .../projects/sympy/sympy/solvers/recurr.py:442:23 - error: Argument of type "Unknown | Basic | Any" cannot be assigned to parameter "args" of type "Expr | complex" in function "__new__"
-     Type "Unknown | Basic" is not assignable to type "Expr | complex"
+     Type "Unknown | Basic | Any" is not assignable to type "Expr | complex"
-   .../projects/sympy/sympy/solvers/recurr.py:453:13 - error: No overloads for "__setitem__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:453:13 - error: Argument of type "One | NegativeOne | Zero | Integer | Unknown" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
-     Type "One | NegativeOne | Zero | Integer | Unknown" is not assignable to type "Zero"
-       "Integer" is not assignable to "Zero" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/solvers.py:3281:19 - error: Operator "/" not supported for types "Literal[1]" and "Unknown | Zero | Float | NotImplementedType | float | Any | NaN | Infinity | NegativeInfinity | Expr | Basic"
+   .../projects/sympy/sympy/solvers/solvers.py:3281:19 - error: Operator "/" not supported for types "Literal[1]" and "Unknown | Zero | Float | NotImplementedType | float | Any | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Expr | Basic"
+   .../projects/sympy/sympy/solvers/solveset.py:987:43 - error: Cannot access attribute "p" for class "NaN"
+     Attribute "p" is unknown (reportAttributeAccessIssue)
+   .../projects/sympy/sympy/solvers/solveset.py:987:43 - error: Cannot access attribute "p" for class "ComplexInfinity"
+     Attribute "p" is unknown (reportAttributeAccessIssue)

... (truncated 1333 lines) ...

spark (https://github.com/apache/spark)
+   .../projects/spark/python/pyspark/pandas/tests/computation/test_corr.py:153:52 - error: Argument of type "str" cannot be assigned to parameter "method" of type "Literal['pearson', 'kendall', 'spearman']" in function "corr"
+     Type "str" is not assignable to type "Literal['pearson', 'kendall', 'spearman']"
+       "str" is not assignable to type "Literal['pearson']"
+       "str" is not assignable to type "Literal['kendall']"
+       "str" is not assignable to type "Literal['spearman']" (reportArgumentType)
+   .../projects/spark/python/pyspark/pandas/tests/computation/test_corr.py:184:56 - error: Argument of type "str" cannot be assigned to parameter "method" of type "Literal['pearson', 'kendall', 'spearman']" in function "corr"
+     Type "str" is not assignable to type "Literal['pearson', 'kendall', 'spearman']"
+       "str" is not assignable to type "Literal['pearson']"
+       "str" is not assignable to type "Literal['kendall']"
+       "str" is not assignable to type "Literal['spearman']" (reportArgumentType)
+   .../projects/spark/python/pyspark/pandas/tests/indexes/test_indexing.py:194:75 - error: Argument of type "Series[Any]" cannot be assigned to parameter "other" of type "str | bytes | date | datetime | timedelta | datetime64[date | int | None] | timedelta64[timedelta | int | None] | bool | int | float | Timestamp | Timedelta | complex | integer[Any] | floating[Any] | complexfloating[Any, Any] | DataFrame | ((...) -> (str | bytes | date | datetime | timedelta | datetime64[date | int | None] | timedelta64[timedelta | int | None] | bool | int | float | Timestamp | Timedelta | complex | integer[Any] | floating[Any] | complexfloating[Any, Any] | DataFrame)) | None" in function "where"
+     Type "Series[Any]" is not assignable to type "str | bytes | date | datetime | timedelta | datetime64[date | int | None] | timedelta64[timedelta | int | None] | bool | int | float | Timestamp | Timedelta | complex | integer[Any] | floating[Any] | complexfloating[Any, Any] | DataFrame | ((...) -> (str | bytes | date | datetime | timedelta | datetime64[date | int | None] | timedelta64[timedelta | int | None] | bool | int | float | Timestamp | Timedelta | complex | integer[Any] | floating[Any] | complexfloating[Any, Any] | DataFrame)) | None"
+       "Series[Any]" is not assignable to "str"
+       "Series[Any]" is not assignable to "bytes"
+       "Series[Any]" is not assignable to "date"
+       "Series[Any]" is not assignable to "datetime"
+       "Series[Any]" is not assignable to "timedelta"
+       "Series[Any]" is not assignable to "datetime64[date | int | None]"
+       "Series[Any]" is not assignable to "timedelta64[timedelta | int | None]"
+     ... (reportArgumentType)
-   .../projects/spark/python/pyspark/pandas/tests/series/test_datetime.py:56:20 - error: Operator "//" not supported for types "Series[Any]" and "timedelta64[timedelta]" (reportOperatorIssue)
-   .../projects/spark/python/pyspark/pandas/tests/series/test_datetime.py:168:17 - error: Operator "/" not supported for types "Series[Any]" and "timedelta64[timedelta]" (reportOperatorIssue)
+   .../projects/spark/python/pyspark/sql/tests/pandas/helper/helper_pandas_transform_with_state.py:2550:43 - error: Argument of type "Series[Any] | Any" cannot be assigned to parameter "expiryTimestampMs" of type "int" in function "registerTimer"
+     Type "Series[Any] | Any" is not assignable to type "int"
+       "Series[Any]" is not assignable to "int" (reportArgumentType)
+   .../projects/spark/python/pyspark/sql/tests/test_udf_in_higher_order_function.py:786:23 - error: No overloads for "transform" match the provided arguments (reportCallIssue)
+   .../projects/spark/python/pyspark/sql/tests/test_udf_in_higher_order_function.py:786:46 - error: Argument of type "(x: Column) -> Series[Any]" cannot be assigned to parameter "f" of type "(Column, Column) -> Column" in function "transform"
+     Type "(x: Column) -> Series[Any]" is not assignable to type "(Column, Column) -> Column"
+       Function accepts too few positional parameters; expected 2 but received 1
+         Function return type "Series[Any]" is incompatible with type "Column"
+           "Series[Any]" is not assignable to "Column" (reportArgumentType)
- 34953 errors, 981 warnings, 0 informations
+ 34957 errors, 981 warnings, 0 informations

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- .../projects/pandas-stubs/tests/indexes/test_add.py
-   .../projects/pandas-stubs/tests/indexes/test_add.py:28:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:29:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:30:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:33:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:34:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:35:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:43:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:44:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:45:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:48:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:49:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:50:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:106:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_add.py:108:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
+   .../projects/pandas-stubs/tests/indexes/test_floordiv.py:39:71 - error: Unnecessary "# pyright: ignore" rule: "reportOperatorIssue" (reportUnnecessaryTypeIgnoreComment)
+   .../projects/pandas-stubs/tests/indexes/test_floordiv.py:39:91 - error: Unnecessary "# pyright: ignore" rule: "reportUnknownVariableType" (reportUnnecessaryTypeIgnoreComment)
-   .../projects/pandas-stubs/tests/indexes/test_floordiv.py:137:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
+   .../projects/pandas-stubs/tests/indexes/test_floordiv.py:47:23 - error: "assert_type" mismatch: expected "TimedeltaIndex" but received "Any" (reportAssertTypeFailure)
+   .../projects/pandas-stubs/tests/indexes/test_floordiv.py:62:71 - error: Unnecessary "# pyright: ignore" rule: "reportOperatorIssue" (reportUnnecessaryTypeIgnoreComment)
+   .../projects/pandas-stubs/tests/indexes/test_floordiv.py:62:91 - error: Unnecessary "# pyright: ignore" rule: "reportUnknownVariableType" (reportUnnecessaryTypeIgnoreComment)
- .../projects/pandas-stubs/tests/indexes/test_mul.py
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:28:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:29:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:30:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:33:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:34:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:35:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:43:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:44:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:45:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:48:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:49:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:50:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:106:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_mul.py:108:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
- .../projects/pandas-stubs/tests/indexes/test_sub.py
-   .../projects/pandas-stubs/tests/indexes/test_sub.py:60:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_sub.py:105:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/indexes/test_truediv.py:106:23 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/scalars/test_scalars.py:1728:21 - error: "assert_type" mismatch: expected "Index[Any]" but received "Any" (reportAssertTypeFailure)
- .../projects/pandas-stubs/tests/series/test_add.py
-   .../projects/pandas-stubs/tests/series/test_add.py:26:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:27:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:28:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:31:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:32:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:33:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:36:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:37:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:38:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:41:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:42:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:43:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:57:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:58:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:59:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:63:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:64:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:65:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:69:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:70:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)
-   .../projects/pandas-stubs/tests/series/test_add.py:71:23 - error: "assert_type" mismatch: expected "Series[Any]" but received "Any" (reportAssertTypeFailure)

... (truncated 195 lines) ...

@rchiodo
Rich Chiodo (rchiodo) merged commit 361c8ff into main Sep 10, 2026
20 checks passed
Rich Chiodo (rchiodo) added a commit that referenced this pull request Sep 11, 2026
…11739)

* Revert nested overload materialization and dependent checker fixes

Selectively roll back #11601, #11621, and checker-only #11732 while preserving primer-analysis tooling and independent subsequent fixes. Retain regression fixtures and document the restored conformance, constructor, and protocol-operation limitations in current-behavior expectations.

Co-authored-by: Copilot App <[email protected]>

* Restore matching gh-aw compiler and runtime for primer analysis

Regenerate with v0.86.2, preserve current artifact action versions, and prevent standalone runtime bumps with a narrow Dependabot ignore and workflow consistency coverage.

Co-authored-by: Copilot App <[email protected]>

* Preserve constructor constraints and results across union branches

Replay each expanded argument using its own overload constraints and retain definitive constructed union branches. Fix the reproduced Werkzeug Mapping-to-dict regression without restoring nested overload materialization, and retain precise positive and negative regression coverage.

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants