fix: normalize search hits and share KA GraphML/CSV export adapters - #2
Merged
Merged
Conversation
CLI and MCP search now go through SearchHits so graph tuples count nodes+edges and graph_rag 3-tuples no longer crash. GraphML/CSV export calls export_ka_* with one graph-type error; default_edge_id lives in exporters/common.py. Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Reuse yifanfeng97#123 wording and banner: refuse a non-empty GraphML file unless --force / MCP overwrite is set. The guard lives in resolve_export_file so CLI and MCP share one path. Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Owner
Author
|
Opened on the fork by mistake; tracked upstream as yifanfeng97#144 (now merged). Closing. |
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.
Summary
he searchand MCPsearchnow go through oneSearchHitsadapter (hyperextract/utils/search_results.py). Graph 2-tuples count nodes + edges, notlen(tuple) == 2. Empty([], [])printsNo results found.instead of two opaque lists.graph_rag3-tuples no longer crash MCP (nodes, edges = results). JSON always includescommunity_context, includingnull. cog_rag-style dicts recursivelymodel_dump.export_ka_graphml/export_ka_csv. Non-graph KAs share one graph-type error.default_edge_idlives inexporters/common.py; GraphML/CSV drop their local copies.resolve_export_fileis incommon.pyfor later formats. This PR does not add GraphML--force(fix: require --force before overwriting GraphML exports yifanfeng97/Hyper-Extract#123 owns that).Closes yifanfeng97#118
Closes yifanfeng97#120
Supersedes yifanfeng97#119 and yifanfeng97#121 — those PRs each fixed one surface; this replaces both.
Out of scope
--force/ banner wording (fix: require --force before overwriting GraphML exports yifanfeng97/Hyper-Extract#123)main, then callexport_ka_*searchsource/tag; MCP parse/feedGraphIndexMixin(RFC: extract GraphIndexMixin for shared merge/search/index yifanfeng97/Hyper-Extract#115) — separate Draft PRGraphMLHypergraphError; version / CHANGELOGTest plan
uv run pytest tests/utils tests/cli tests/types tests/test_mcp_server.pyNo results found., noResult 1community_context: nulland does not raisetests/utils/test_exporters.pyexpectations unchanged