Skip to content

fix(igraph): pick the node ID column without a bookkeeping flag - #2098

Merged
lmeyerov merged 1 commit into
masterfrom
fix/pyright-plugins
Sep 18, 2026
Merged

lmeyerov merged 1 commit into
masterfrom
fix/pyright-plugins

Conversation

@lmeyerov

Copy link
Copy Markdown
Contributor

Sixth of the pyright-ratchet cleanup series. Ratchet 245 → 240.

What

from_igraph's third branch — the one that un-swizzles integer vertex IDs — recorded success in a separate found boolean, so node_id_col was bound inside the loop and read after it, with if not found as the only thing tying the two together.

The name is in fact always bound: every arm of the chain either assigns it or raises ValueError. But nothing local says so, which is why it read as possibly unbound. Binding node_id_col = None up front and testing that instead says the same thing with one name rather than two, and the flag disappears.

Also pass for a bare 1 used as a no-op — the same idiom cleared from PlotterBase in #2095.

Verification

Behaviour checked rather than assumed. Round-trips through igraph produce byte-identical edge frames on master and here, for all three shapes that reach different arms of the chain:

shape reaches
named vertices node_col in ig_vs_df
integer vids the sortable-dimension branch this PR touches
bare attribute-less graph len(ig_vs_df.columns) == 0

bin/lint.sh (ruff, type-hygiene 4448, comment-density 1151) · pyright guard 240 · mypy 351 files · changed-line coverage 3/3 = 100% · 37 igraph tests, 50 plugin tests.

Coverage is real here rather than pragma'd: test-core-python installs igraph via the test-core lockfile and uploads the artifact the changed-line gate consumes.

Not here

cugraph's eight findings are GPU-only, so no lane feeding the changed-line gate can execute them and they want dgx validation of their own. They follow separately rather than riding along behind pragmas.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ropeBMLJUuy6ViYwy15ud

from_igraph's third branch, which un-swizzles integer vertex IDs, recorded
success in a separate `found` boolean: node_id_col was bound inside the loop
and read after it, with `if not found` as the only thing tying the two
together. The name is in fact always bound -- every arm of the chain either
assigns it or raises -- but nothing local says so, which is why it read as
possibly unbound.

Binding node_id_col = None up front and testing that instead says the same
thing with one name rather than two, and the flag disappears.

Behaviour verified rather than assumed: round-trips through igraph produce
byte-identical edge frames on master and here for all three shapes that reach
different arms -- named vertices, integer vids (the arm this touches), and a
bare attribute-less graph. 37 igraph tests, 50 plugin tests.

Also `pass` for a bare `1` used as a no-op, the same idiom cleared from
PlotterBase in #2095.

cugraph's findings are not here: they are GPU-only, so no lane feeding the
changed-line gate can execute them, and they want dgx validation of their own.

Pyright ratchet 245 -> 240 (-5). Changed-line coverage 3/3.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_017ropeBMLJUuy6ViYwy15ud
@lmeyerov
lmeyerov merged commit 5f6b16f into master Sep 18, 2026
80 checks passed
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.

1 participant