Skip to content

fix: pass configured Neo4j database to execute_query#1482

Open
abhinavmathur-atlan wants to merge 1 commit into
getzep:mainfrom
abhinavmathur-atlan:fix-neo4j-execute-query-database
Open

fix: pass configured Neo4j database to execute_query#1482
abhinavmathur-atlan wants to merge 1 commit into
getzep:mainfrom
abhinavmathur-atlan:fix-neo4j-execute-query-database

Conversation

@abhinavmathur-atlan
Copy link
Copy Markdown

@abhinavmathur-atlan abhinavmathur-atlan commented May 9, 2026

Summary

Fixes Neo4jDriver.execute_query() so the configured database is passed to the Neo4j driver as the top-level database_ argument instead of being inserted into Cypher parameters_.

This keeps query parameters separate from driver configuration and allows read/search queries to run against the configured database instead of Neo4j's default database.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

Bug fix for configured Neo4j databases: writes already use session(database=self._database), but reads through execute_query() were not selecting the configured database.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • All existing tests pass

Validation run:

  • uv run --extra dev pytest tests/driver/test_neo4j_driver.py
  • uv run --extra dev pytest tests/driver
  • uv run --extra dev ruff format graphiti_core/driver/neo4j_driver.py tests/driver/test_neo4j_driver.py
  • uv run --extra dev ruff check graphiti_core/driver/neo4j_driver.py tests/driver/test_neo4j_driver.py
  • uv run --extra dev pyright ./graphiti_core

I also started DISABLE_FALKORDB=1 DISABLE_KUZU=1 DISABLE_NEPTUNE=1 uv run --extra dev pytest -m "not integration"; it progressed through the driver tests but then hit repeated errors in existing graph tests outside this driver change, so I stopped it and kept the validation scoped to the touched driver path.

Breaking Changes

  • This PR contains breaking changes

Checklist

  • Code follows project style guidelines (make lint passes)
  • Self-review completed
  • Documentation updated where necessary
  • No secrets or sensitive information committed

Related Issues

Closes #1481

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.

[BUG] Database Parameter Not Honored in Neo4jDriver.execute_query()

1 participant