Fix RXFilter.node_ids() dropping selected nodes with include flags#315
Merged
JoOkuma merged 1 commit intoJul 1, 2026
Merged
Conversation
When include_targets/include_sources was set (or edge filters were present), the rustworkx filter rebuilt the node selection purely from edge endpoints: - explicitly selected or attribute-filtered nodes without matching edges (e.g. isolated nodes) were dropped from node_ids(); - both endpoints were added regardless of which include flag was set, pulling in sources that include_targets never asked for. Keep the base selection and only extend it with the endpoints the include flags request, matching SQLFilter. Pure edge-filtered queries still return the matching edges' endpoints.
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.
With
include_targets/include_sources(or edge filters),node_ids()was rebuilt purely from edge endpoints: explicitly selected nodes without edges (e.g. isolated nodes) were dropped, and both endpoints were added regardless of which flag was set. SQLGraph keeps them.Keep the base selection and extend it only with the endpoints the include flags request; pure edge-filtered queries still return the matching edges' endpoints.
Added a backend-parametrized regression test.
Note: overlaps with #314 in a test file; whichever lands second needs a trivial rebase.