Commit c76f23a
Both were found by running the repo's own mypy config against a real
pandas-stubs install. CI's `python-lint-types` cannot see them: `bin/typecheck.sh`
prefers `uvx mypy`, which runs mypy in an isolated ephemeral env with none of the
locked stubs, so every pandas symbol degrades to `Any` (see #1791 for the full
triage — CI's own pinned pandas-stubs 3.0.3.260530 already reports 140 errors).
1. graphviz: `KeyError: None` on a bound-but-unlabelled frame
`g_to_pgv` asserts `_nodes`/`_edges` are set but not that the *bindings* are.
`g.nodes(df)` with no `node=` (or `g.edges(df)` with no source/destination)
leaves them None, and `layout_graphviz`/`render_graphviz` only call
`materialize_nodes()` when `_nodes` is None — so those graphs reached
`row[None]` and died with a bare `KeyError: None` from inside the row loop.
Now resolved once, up front, into non-Optional locals with an actionable
ValueError. Validation moved ahead of the optional `pygraphviz` import so a
caller error is not masked by a missing-backend error (and so it is testable
without the optional dep).
2. search_any: `pat` was bound to BOTH a module and a str in one scope
`import pandas.api.types as pat` and, 10 lines later, `pat, case = term, ...`.
Ordering saves it today (the module use strictly precedes the rebind), but it
is one statement reorder from `AttributeError: 'str' object has no attribute
'is_bool_dtype'`. Renamed the module alias to `pd_types`.
Also corrects two `dtype: object` params to the engine-agnostic `DType` alias —
these receive pandas/cuDF/polars dtypes, so `object` was both less accurate and
on the repo's banned-annotation list.
mypy differential under CI's own pin (mypy 2.1.0 + pandas-stubs 3.0.3.260530):
140 -> 128, zero new errors, `search_any.py` and `graphviz.py` both to zero.
Under the container stubs (pandas-stubs 3.0.0.260204 + mypy 1.19.1): 173 -> 161.
ruff clean. `graphistry/tests/compute` with `--gpus all`: 9 failed / 7030 passed,
identical to the master baseline (all 9 pre-existing igraph/cudf/dask).
Claude-Session: https://claude.ai/code/session_015YsqAZQLbqjSDrYSFz2GoB
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 4415116 commit c76f23a
3 files changed
Lines changed: 58 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | | - | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
| |||
58 | 78 | | |
59 | 79 | | |
60 | 80 | | |
61 | | - | |
| 81 | + | |
62 | 82 | | |
63 | 83 | | |
64 | 84 | | |
| |||
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
78 | | - | |
79 | | - | |
| 98 | + | |
| 99 | + | |
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
0 commit comments