fix(falkor): strip nul bytes from parameters#1531
Merged
Merged
Conversation
Collaborator
|
Hi @he-yufeng — thanks for this fix! 🙏 To sign, just reply to this PR with the following comment, exactly as written: |
devmao
pushed a commit
to devmao/graphiti
that referenced
this pull request
Jun 8, 2026
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
Fixes #1525.
FalkorDB rejects query parameters that contain embedded NUL bytes, and the failure happens before the query body runs. Ingested text from PDFs/PPTX can contain stray
\x00, so a single bad string can make a whole bulk save query fail.This strips NUL bytes from FalkorDB query parameters before calling the FalkorDB client. The cleanup is recursive for dict/list/tuple values and is applied in both driver paths that send params:
FalkorDriver.execute_query(...)FalkorDriverSession.run(...), including list-of-query batchesValid strings are unchanged; only
\x00is removed.To verify
$env:DISABLE_KUZU='True'; <pytest bootstrap>; pytest tests/driver/test_falkordb_driver.py::{new and adjacent tests} -q->4 passedpython -m py_compile graphiti_core\driver\falkordb_driver.py tests\driver\test_falkordb_driver.pypython -m ruff check graphiti_core\driver\falkordb_driver.py tests\driver\test_falkordb_driver.pypython -m ruff format --check graphiti_core\driver\falkordb_driver.py tests\driver\test_falkordb_driver.pygit diff --checkNote: this Windows environment has another editable checkout exposing a top-level
testspackage, so I used a small bootstrap to pointtestsat this repository before invoking pytest.DISABLE_KUZU=Trueavoids importing the optional Kuzu driver for these Falkor-only unit tests.