You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: bare method calls (x.get(...)) bind to a same-named module-level function — false calls edges create a god node (reproduces on every 0.9.x I tested) #2417
In Python extraction, an unresolved attribute call x.get(k) is resolved by bare name to a module-level function get defined in the project, producing a calls edge that does not exist. Any codebase that both defines a short, common function name (get, set, run, …) and uses the same method name on dicts/clients gets that function inflated into the #1 god node.
This is the Python call-site counterpart of #2241 (JS/TS closure arguments, fixed in 0.9.29) and looks closely related to #2315 (Python @receiver.name(...) decorators binding to an unrelated module-level function of the same bare name) — possibly the same bare-name fallback in the Python resolver.
Minimal reproduction (~30s)
fixture.py, alone in an empty directory:
defget(k):
"""Module-level function that shares a name with dict/mapping .get."""returnkclassStore:
def__init__(self):
self.store= {}
defread(self, k):
returnself.store.get(k)
defother(d):
returnd.get('x')
defreal():
returnget('real')
graphify .
Then count calls edges whose target is the node labelled get() (the module-level function; methods are labelled .name()):
self.store.get(k) is a dict lookup and d.get('x') is a call on an unannotated parameter; neither can be resolved to the module-level get, but both are bound to it.
Version sweep
Same fixture, run via uv tool run --from graphifyy==<version> graphify .:
15/15 buggy — so this is not a regression introduced by a recent release. (0.8.0 could not be installed here: dependency resolution fails.)
Impact on a real repo
On a ~3.3k-node Python project, one rebuild made the project's get() in settings_store.py jump from degree 27 to 149, taking the #1 god-node slot. A single module contributed 42 of those edges while never importing settings_store — it simply contains 127 .get( call sites. Across that rebuild, 122 of the 200 newly-added edges (61%) were false edges of this shape (net edge count 6,927 → 7,110).
Downstream, this corrupts god-node ranking, explain <node>, and community assignment, and there is no version to pin to as a workaround.
Suggested direction
Don't fall back to bare-name matching for attribute calls when the receiver is unresolved. If a fallback is needed for recall, emit it at a lower confidence and/or as a distinct relation so consumers can filter it, rather than as a plain calls edge.
Environment
graphify 0.9.32 (and the 14 older versions above), installed via uv tool / uv tool run
The three edges are unchanged in identity, not just in count:
other() -> get()
real() -> get()
.read() -> get()
Only real() -> get() is genuine. So this is not a partial fix — resolving either d.get('x') or self.store.get(k) alone would have left 2 — and the node labelling is unchanged (get() for the module-level function, .read() for the method), so it isn't a schema shift masking a fix either.
That makes it 16 of 16 versions tested: the 15 in the sweep above plus 0.9.33.
Why this one matters more than the count
The sweep already established there's no version to pin to. What 0.9.33 adds is that a release landed after the report with the bare-name fallback untouched, so downstream consumers can't treat "wait for the next release" as a workaround either. We've settled on read-time filtering — treating degree spikes on short common method names (get/set/run) as suspect in god-node ranking, explain, and community output — and we re-adjudicate only when the version rises. Happy to re-run the fixture on any branch or pre-release if that would help confirm a fix.
Fixed in v0.9.39. A Python member call on an untyped receiver (x.get(...)) no longer binds by name alone to a same-named module-level function. Such a call is now deferred to the evidence-gated resolver and only resolves with receiver-type / import / self/cls/super evidence (matching the TypeScript fix from 0.9.37), so the false high-confidence edges that formed a get() god node are gone; super().method() still resolves. Thanks @EZZEASY for the fix (PR #2586).
Activity
dispather commentedon Aug 5, 2026
0.9.33 still reproduces — 16/16
Re-ran the fixture from the report against 0.9.33, which released after this was filed.
callsintoget()To rule out a stale environment, I captured the 0.9.32 baseline in the same shell session immediately before upgrading:
The three edges are unchanged in identity, not just in count:
Only
real() -> get()is genuine. So this is not a partial fix — resolving eitherd.get('x')orself.store.get(k)alone would have left 2 — and the node labelling is unchanged (get()for the module-level function,.read()for the method), so it isn't a schema shift masking a fix either.That makes it 16 of 16 versions tested: the 15 in the sweep above plus 0.9.33.
Why this one matters more than the count
The sweep already established there's no version to pin to. What 0.9.33 adds is that a release landed after the report with the bare-name fallback untouched, so downstream consumers can't treat "wait for the next release" as a workaround either. We've settled on read-time filtering — treating degree spikes on short common method names (
get/set/run) as suspect in god-node ranking,explain, and community output — and we re-adjudicate only when the version rises. Happy to re-run the fixture on any branch or pre-release if that would help confirm a fix.Environment
uv tool upgrade graphifyyfix(extract): affected traverses in-function dynamic imports; Python …
safishamsi commentedon Aug 10, 2026
Fixed in v0.9.39. A Python member call on an untyped receiver (
x.get(...)) no longer binds by name alone to a same-named module-level function. Such a call is now deferred to the evidence-gated resolver and only resolves with receiver-type / import /self/cls/superevidence (matching the TypeScript fix from 0.9.37), so the false high-confidence edges that formed aget()god node are gone;super().method()still resolves. Thanks @EZZEASY for the fix (PR #2586).fix(extract): affected traverses in-function dynamic imports; Python …