fix: accept 'links' key from NetworkX <=3.1 alongside 'edges'#212
Closed
mrsyb wants to merge 1 commit into
Closed
Conversation
NetworkX changed its node_link_data() default edge key from 'links' (<=3.1) to 'edges' (>=3.2). Any data serialised with an older NetworkX version — or any serialiser that follows the original JSON Graph Format spec — uses 'links', causing graphify to silently produce graphs with zero edges. Changes: - validate.py: fall back to data['links'] when data['edges'] is absent - build.py: normalise 'links' -> 'edges' at the top of build_from_json() Both fixes are backward-compatible: data already using 'edges' is unaffected. Tests added: - test_build_from_json_with_links_key (old-style 'links' key) - test_build_from_json_with_edges_key (new-style 'edges' key, current NX) - test_links_key_accepted_as_edges (validate accepts 'links') - test_edges_key_takes_priority_over_links (priority order is correct)
safishamsi
added a commit
that referenced
this pull request
Apr 11, 2026
- build/validate: accept NetworkX <=3.1 "links" key alongside "edges" (#212) - __main__: skip version check during install/uninstall, deduplicate paths (#220) - all file IO: explicit encoding="utf-8" to prevent crashes on Windows CJK locales (#204) - hooks: add newline="\n" on write to prevent CRLF shebang breakage on Windows (#204) - export: strip trailing .md from safe_name so "CLAUDE.md" doesn't become "CLAUDE.md.md" (#221) - report: add Community Hubs navigation block so Obsidian vault stays connected (#221) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
Cherry-picked into v0.4.2 — thank you! |
joyshmitz
pushed a commit
to joyshmitz/graphify
that referenced
this pull request
Apr 13, 2026
…hamsi#221 into 0.4.2 - build/validate: accept NetworkX <=3.1 "links" key alongside "edges" (safishamsi#212) - __main__: skip version check during install/uninstall, deduplicate paths (safishamsi#220) - all file IO: explicit encoding="utf-8" to prevent crashes on Windows CJK locales (safishamsi#204) - hooks: add newline="\n" on write to prevent CRLF shebang breakage on Windows (safishamsi#204) - export: strip trailing .md from safe_name so "CLAUDE.md" doesn't become "CLAUDE.md.md" (safishamsi#221) - report: add Community Hubs navigation block so Obsidian vault stays connected (safishamsi#221) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
safishamsi
added a commit
that referenced
this pull request
Apr 23, 2026
- build/validate: accept NetworkX <=3.1 "links" key alongside "edges" (#212) - __main__: skip version check during install/uninstall, deduplicate paths (#220) - all file IO: explicit encoding="utf-8" to prevent crashes on Windows CJK locales (#204) - hooks: add newline="\n" on write to prevent CRLF shebang breakage on Windows (#204) - export: strip trailing .md from safe_name so "CLAUDE.md" doesn't become "CLAUDE.md.md" (#221) - report: add Community Hubs navigation block so Obsidian vault stays connected (#221) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
matzls
pushed a commit
to matzls/graphify
that referenced
this pull request
May 10, 2026
…hamsi#221 into 0.4.2 - build/validate: accept NetworkX <=3.1 "links" key alongside "edges" (safishamsi#212) - __main__: skip version check during install/uninstall, deduplicate paths (safishamsi#220) - all file IO: explicit encoding="utf-8" to prevent crashes on Windows CJK locales (safishamsi#204) - hooks: add newline="\n" on write to prevent CRLF shebang breakage on Windows (safishamsi#204) - export: strip trailing .md from safe_name so "CLAUDE.md" doesn't become "CLAUDE.md.md" (safishamsi#221) - report: add Community Hubs navigation block so Obsidian vault stays connected (safishamsi#221) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NetworkX changed its node_link_data() default edge key from 'links' (<=3.1) to 'edges' (>=3.2). Any data serialised with an older NetworkX version — or any serialiser that follows the original JSON Graph Format spec — uses 'links', causing graphify to silently produce graphs with zero edges.
Changes:
Both fixes are backward-compatible: data already using 'edges' is unaffected.
Tests added: