Skip to content

Support EagerResult from driver.execute_query() in from_neo4j()#335

Merged
FlorentinD merged 4 commits into
neo4j:mainfrom
jexp:feat/driver_execute_query
Apr 27, 2026
Merged

Support EagerResult from driver.execute_query() in from_neo4j()#335
FlorentinD merged 4 commits into
neo4j:mainfrom
jexp:feat/driver_execute_query

Conversation

@jexp
Copy link
Copy Markdown
Member

@jexp jexp commented Apr 21, 2026

from_neo4j() now accepts neo4j.EagerResult (the default return type of driver.execute_query()). The implementation recovers the bolt hydration Graph directly from the entity back-references on record values, giving the same complete graph that Result.graph() would return — including start/end nodes not explicitly selected.

A _collect_graph_entities() helper handles the fallback for results with no direct graph columns (paths, nested lists/dicts). Unit tests for the helper are in test_collect_graph_entities.py; an integration test for the full EagerResult path is added to test_neo4j.py.

Make sure:

  • You signed the Neo4j CLA (Contributor License Agreement) so that we are allowed to ship your code in our library
  • Your contribution is covered by tests

jexp added 2 commits April 21, 2026 02:24
from_neo4j() now accepts neo4j.EagerResult (the default return type of
driver.execute_query()). The implementation recovers the bolt hydration
Graph directly from the entity back-references on record values, giving
the same complete graph that Result.graph() would return — including
start/end nodes not explicitly selected.

A _collect_graph_entities() helper handles the fallback for results with
no direct graph columns (paths, nested lists/dicts). Unit tests for the
helper are in test_collect_graph_entities.py; an integration test for the
full EagerResult path is added to test_neo4j.py.
Comment thread python-wrapper/src/neo4j_viz/neo4j.py Outdated
Comment thread python-wrapper/src/neo4j_viz/neo4j.py Outdated
Comment thread python-wrapper/src/neo4j_viz/neo4j.py
* dont rebuild graph object and avoid using internal APIs
@FlorentinD FlorentinD merged commit d979968 into neo4j:main Apr 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants