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: applying a decorator creates no edge — affected <decorator> returns "No affected nodes found" for every function it wraps #2154
Applying a decorator (@my_decorator) creates no edge between the decorated function and the decorator. The decorated function looks independent of the thing that wraps it, so reverse-impact queries miss it.
Six downstream repos consume the package only through @md_py / @md_upload. Because decoration creates no edge, reverse traversal from the decorator finds none of the functions it wraps, and:
$ graphify affected md_py --depth 2
No affected nodes found.
That is a false negative on a "what breaks?" question — cheap, fast, confident, and wrong. It is more dangerous than no answer, because an empty result reads as "nothing depends on this."
Suggested fix
When a decorated_definition / decorator list is present, emit an edge from the decorated symbol to the decorator (e.g. decorated_by, or reuse uses / calls). Python is the clearest case; the same applies to TS/JS decorators.
Possibly related: #1566 (extending indirect_call to remaining dispatch patterns) — decoration is arguably another dispatch pattern.
The decorator children are walked, but no branch consumes them, so nothing is emitted. TS/JS instead goes through _ts_emit_decorator_edges, which emits references edges with context="decorator" resolved through ensure_named_node. Python was simply never wired up.
Verified on 0.9.26 with your repro. Before:
Affected nodes for my_decorator()
- consumer.py [imports] pkg/consumer.py:L1
Activity
Rishet11 commentedon Jul 25, 2026
Root cause is in the Python walk, and TS/JS already has the behaviour this issue asks for.
decorated_definitionis handled as a transparent wrapper so a decorated method keeps its class-qualified node id (#1050):The
decoratorchildren are walked, but no branch consumes them, so nothing is emitted. TS/JS instead goes through_ts_emit_decorator_edges, which emitsreferencesedges withcontext="decorator"resolved throughensure_named_node. Python was simply never wired up.Verified on 0.9.26 with your repro. Before:
After porting the TS path to Python:
Working on this now, PR shortly. It mirrors the TS helper, so there is no new edge type and no schema/exporter/
affectedchange.fix(extract): emit references edges for Python decorators (#2154)
test(extract): cover Python decorator reference edges (#2154)
fix(extract): suppress builtin/stdlib Python decorators from referenc…
chore: bump to 0.9.27; changelog for #2167/#2169/#2154/#2153/#2147/#2168
safishamsi commentedon Jul 26, 2026
Fixed in v0.9.27 (#2175, thanks @Rishet11). Python decorators now emit reference edges so affected finds what they touch; builtin/stdlib decorators are excluded. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.27
Squashed commit of the following:
fix(extract): emit references edges for Python decorators (Graphify-L…
test(extract): cover Python decorator reference edges (Graphify-Labs#…
fix(extract): suppress builtin/stdlib Python decorators from referenc…
chore: bump to 0.9.27; changelog for Graphify-Labs#2167/Graphify-Labs…
fix(extract): stop Python property-accessor decorators minting stub n…