Repository navigation
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 98.60%. The percentage of expected errors that received a diagnostic held steady at 98.86%. The number of fully passing files held steady at 137/146. Results for 0f304c7 · Workflow run |
Memory usage reportMemory usage unchanged ✅ Results for 0f304c7 · Workflow run |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
unsound-return-statement |
0 | 4 | 0 |
| Total | 0 | 4 | 0 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Raw diff:
xarray (https://github.com/pydata/xarray)
- xarray/plot/facetgrid.py:1096:16 warning[unsound-return-statement] Unsound return statement: `FacetGrid[Unknown]` is not a subtype of `FacetGrid[T_DataArrayOrSet@_easy_facetgrid]`
- xarray/plot/facetgrid.py:1099:16 warning[unsound-return-statement] Unsound return statement: `FacetGrid[Unknown]` is not a subtype of `FacetGrid[T_DataArrayOrSet@_easy_facetgrid]`
- xarray/plot/facetgrid.py:1102:16 warning[unsound-return-statement] Unsound return statement: `FacetGrid[Unknown]` is not a subtype of `FacetGrid[T_DataArrayOrSet@_easy_facetgrid]`
- xarray/plot/facetgrid.py:1105:16 warning[unsound-return-statement] Unsound return statement: `FacetGrid[Unknown]` is not a subtype of `FacetGrid[T_DataArrayOrSet@_easy_facetgrid]`Full report with detailed diff · Timing results
Results for 0f304c7 · Workflow run
Ecosystem reportPR #30294 ecosystem summaryFour warnings disappeared from xarray’s plotting code. Each affected method returns the grid it was called on. ty now preserves that grid’s data type across the call. These were the only stable diagnostic changes. Diagnostic changes (1 section)1. xarray plotting methods preserve the grid’s data type4 removed Report entries
xarray’s class FacetGrid[T]:
data: T
def map_dataarray_line[G: FacetGrid](self: G) -> G:
return self
def _easy_facetgrid[T](g: FacetGrid[T]) -> FacetGrid[T]:
return g.map_dataarray_line()ReproductionVersions and settings
|
A generic function that returns its argument can lose the caller’s type variable when its bound contains
AnyorUnknown. For example, ty inferredlist[Any]forkeep(items)here and reportedunsound-return-statementwhen that rule was enabled. It now inferslist[T].The argument gives the solver
list[T] ≤ L, and the return annotation gives itL ≤ list[T]. The solver combines those constraints asL = list[T]. When it checkslist[T]against the declared boundlist[Any], its invariant comparison recordsT = Any. That comparison succeeds for every caller specialization ofT. Using the recorded equality to rewrite the argument constraint giveslist[Any] ≤ L.The solver previously treated this last step as replacing the argument constraint, so it lost the evidence that the caller passed
list[T]. When the replacement usesAnyorUnknownfrom a constraint with declared provenance, ty now records the implication and keeps the original argument constraint available for inference.Test plan
Compared the four returns in xarray’s
_easy_facetgridonmainand with the sequent change alone. All four previously reportedFacetGrid[Unknown]where the caller expectedFacetGrid[T_DataArrayOrSet]. All four warnings clear with this change.Ecosystem report
On
0f304c75, the only stable changes were four removedunsound-return-statementwarnings in xarray. Each plotting method returns its receiver, and ty now preserves the grid’s data type on all four returns. Full ecosystem report