projection_planning.py is invisible to ruff, mypy and pyright
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- testing-qa, tooling
Direzione di ricerca
Start with graphistry/compute/gfql/cypher/projection_planning.py and lowering.py to understand the imports and circular dependency; then inspect the pyright baseline entry and run bin/ci/ci_pyright_guard.py. The issue proposes replacing the namespace copy with explicit imports and removing the file-wide suppressions, but leaves the dependency-design choice open. Done means the file has no reportUndefinedVariable findings and the three checkers can check it without those suppressions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
graphistry/compute/gfql/cypher/projection_planning.py is 698 lines and 14 top-level functions that no static checker can see.
How
# mypy: ignore-errors
# ruff: noqa: F821
from graphistry.compute.gfql.cypher import lowering as _lowering
globals().update(vars(_lowering))
The module builds its namespace at import time by copying lowering's globals. Roughly fifty names arrive that way — Optional, Mapping, Any, Dict, List, cast, re, pd, plus the domain types (ASTObject, ASTEdge, CypherQuery, ExprNode, GFQLValidationError, _ProjectionPlan, ResultProjectionPlan, …) and helpers (_unsupported, lower_match_clause, _parse_row_expr, …).
No tool can follow that, so each was silenced in turn:
| checker | how it is silenced | cost |
|---|---|---|
| ruff | # ruff: noqa: F821 |
file-wide, all rules that depend on name resolution |
| mypy | # mypy: ignore-errors |
file-wide, every error class |
| pyright | not silenced — reports 195 reportUndefinedVariable |
baselined in bin/ci/ci_pyright_baseline.json |
Those 195 are 195 of the 240 findings currently in the pyright ratchet. One file is 81% of the baseline, and none of its findings are real defects — they are artifacts of a namespace no checker can model.
Why it is shaped this way
lowering.py imports projection_planning lazily from inside five separate functions, which is the usual sign of a circular dependency being worked around. The globals().update(...) is the other half of that workaround: rather than importing what it needs, the module inherits its parent's entire namespace.
Why it is worth fixing
A file with zero static checking is where a typo, an unbound local or a stale import survives review. This is the module that plans Cypher RETURN/ORDER BY projection — not a peripheral one.
Suggested direction
Replace the namespace copy with explicit imports, breaking the cycle properly (a shared module for the types both files need, or moving the planning helpers into lowering if the split no longer earns its keep). Then drop both suppression comments and let the three checkers see it.
The ratchet gives an objective success measure: bin/ci/ci_pyright_guard.py should show this file's reportUndefinedVariable count going to zero, and --strict will lock each improvement as it lands.
Not urgent, but not free
Nothing is broken today. The cost is ongoing: every future change to this file is unreviewed by tooling, and the ratchet's headline number stays dominated by noise.
Context: the pyright gate landed in #2092; the baseline entry for this file was left visible rather than excluded precisely so fixing it shows up as slack under --strict.
- Lingua principale
- Python
- Stelle
- 2.6k
- Fork
- 229
- Merge medio
- 1g 5h
- PR unite (30g)
- 99
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphistry/pygraphistry
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
graphistry/pygraphistry#2171 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
graphistry/pygraphistry#1965 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
graphistry/pygraphistry#1208 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
graphistry/pygraphistry#966 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
graphistry/pygraphistry#824 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di graphistry/pygraphistry
Issue simili
-
bug module:nodes tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rocketride-org/rocketride-server#3020 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
bretterer/home-assistant-rivian#335 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
mampfes/hacs_waste_collection_schedule#8114 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TIGER-AI-Lab/ClawBench#475 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
UKGovernmentBEIS/inspect_ai#6322 ·
I maintainer di solito rispondono entro 1 giorno