Repository navigation
fix(export): ignore null or empty _src/_tgt markers in to_cypher - #5644
Gaurav-meena95 wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @Gaurav-meena95. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify review 
1 possible issue to check · High impact
1 possible issue we couldn't confirm
- Test named for empty
_src/_tgtmarkers never passes an empty string, so the empty-marker fix is not checked ·tests/test_export.py:1970
They don't change the score.
Code graph · 1161 functions depend on this change
- 1 function became more coupled.
to_cypher()(13 callers). - 54 of 658 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed f42cf30
Extractor accuracy (Swift #5641, Apex #5627, Python #5647, TypeScript #5604/#5614/#5612, Bash caller-var #5602), GitHub Actions run-step extraction (#5603), incremental correctness (#5634/#5638/#5636), symlink and semantic-cache fixes (#5617/#5618), export/report hardening and perf (#5643/#5644/#5645/#5646/#5619/#5620/#5621), and CLI/docs/skill/install work (#5629/#5628/#5626/#5624/#5623/#5625/#5642/#5583). AST cache schema 59 to 60; Swift/Apex/Python/Bash/GHA inputs re-extract on first build. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in v0.9.124 (just released to PyPI), cherry-picked with your authorship preserved so it shows under your name in the history. Thanks @Gaurav-meena95 for ignoring null/empty _src/_tgt markers in to_cypher — verified green in the full suite and, where applicable, smoke-tested against the published package. 🙏 |
What does this PR do?
Guards
_srcand_tgtedge direction overrides into_cypher()(graphify/export.py) soNoneor empty-string markers fall back to the NetworkX edge endpoints(u, v)while preserving valid falsy integer IDs such as0.Problem
to_cypher()usedu, v = data.get("_src", u), data.get("_tgt", v). When an edge carried"_src": nullor"_tgt": null(or""),data.get(...)returnedNoneinstead ofu/v, causing_cypher_escape(None)to emitMATCH (a {id: ''}), (b {id: ''})and attach edges to nonexistent empty-ID nodes.Details
to_cypher()(graphify/export.py)data.get("_src", u), data.get("_tgt", v)u/vwhen_src/_tgtis notNoneand not""0tests/test_export.py_src=None/_tgt=Noneor_src=0test_to_cypher_ignores_null_or_empty_src_tgt_and_preserves_zeroNone/""and preservation of0Type of change
How was this tested?