Skip to content

Fix LanceDB db_uri validation check #1991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mohiuddin-khan-shiam
Copy link

Fix LanceDB db_uri validation check

The _validate_vector_store_db_uri method compared store.db_uri.strip (the method) to an empty string, which was always False.
As a result, whitespace-only or empty db_uri values for LanceDB were silently accepted, leading to mis-configured vector-store paths and runtime failures when later resolving or connecting to the database.

This patch calls strip() before the comparison:

if not store.db_uri or store.db_uri.strip() == "":

Now the validator correctly rejects blank or whitespace-only URIs, preventing invalid configurations from slipping through and improving overall robustness of the GraphRAG setup process.

odiomarcelino and others added 2 commits June 29, 2025 18:35
…hrag/graphrag/config/models/graph_rag_config.py:293:4-300:82) validation check

The [_validate_vector_store_db_uri](cci:1://file:///c:/Users/T2430514/Downloads/graphrag/graphrag/config/models/graph_rag_config.py:293:4-300:82) method compared `store.db_uri.strip` (the method) to an empty string, which was always `False`.
As a result, whitespace-only or empty [db_uri](cci:1://file:///c:/Users/T2430514/Downloads/graphrag/graphrag/config/models/graph_rag_config.py:293:4-300:82) values for LanceDB were silently accepted, leading to mis-configured vector-store paths and runtime failures when later resolving or connecting to the database.

This patch calls `strip()` before the comparison:

```python
if not store.db_uri or store.db_uri.strip() == "":
```
Now the validator correctly rejects blank or whitespace-only URIs, preventing invalid configurations from slipping through and improving overall robustness of the GraphRAG setup process.

Co-Authored-By: S. M. Mohiuddin Khan Shiam <147746955+mohiuddin-khan-shiam@users.noreply.github.com>
The [_validate_vector_store_db_uri](cci:1://file:///c:/Users/T2430514/Downloads/graphrag/graphrag/config/models/graph_rag_config.py:293:4-300:82) method compared `store.db_uri.strip` (the method) to an empty string, which was always `False`.  
As a result, whitespace-only or empty [db_uri](cci:1://file:///c:/Users/T2430514/Downloads/graphrag/graphrag/config/models/graph_rag_config.py:293:4-300:82) values for LanceDB were silently accepted, leading to mis-configured vector-store paths and runtime failures when later resolving or connecting to the database.

This patch calls `strip()` before the comparison:

```python
if not store.db_uri or store.db_uri.strip() == "":
```
Now the validator correctly rejects blank or whitespace-only URIs, preventing invalid configurations from slipping through and improving overall robustness of the GraphRAG setup process.
@mohiuddin-khan-shiam mohiuddin-khan-shiam requested a review from a team as a code owner June 29, 2025 12:37
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