Skip to content

Commit a9acce9

Browse files
committed
style: apply pre-commit formatting
1 parent 7c44028 commit a9acce9

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/lang2sql/integrations/vectorstore/faiss_.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ def save(self, path: str | None = None) -> None:
8585
raise RuntimeError("Cannot save before any upsert() call.")
8686
pathlib.Path(path).parent.mkdir(parents=True, exist_ok=True)
8787
_faiss.write_index(self._index, path)
88-
pathlib.Path(path + ".meta").write_text(
89-
json.dumps(self._ids), encoding="utf-8"
90-
)
88+
pathlib.Path(path + ".meta").write_text(json.dumps(self._ids), encoding="utf-8")
9189

9290
@classmethod
9391
def load(cls, path: str) -> "FAISSVectorStore":
@@ -99,9 +97,7 @@ def load(cls, path: str) -> "FAISSVectorStore":
9997
raise IntegrationMissingError("faiss", hint="pip install faiss-cpu")
10098
meta_path = pathlib.Path(path + ".meta")
10199
if not pathlib.Path(path).exists() or not meta_path.exists():
102-
raise FileNotFoundError(
103-
f"Index files not found: {path}, {path}.meta"
104-
)
100+
raise FileNotFoundError(f"Index files not found: {path}, {path}.meta")
105101
store = cls(index_path=path)
106102
store._index = _faiss.read_index(path)
107103
store._ids = json.loads(meta_path.read_text(encoding="utf-8"))

tests/test_integrations_faiss_vectorstore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
All tests are auto-skipped when faiss-cpu is not installed.
55
"""
6+
67
import pytest
78

89
faiss = pytest.importorskip("faiss") # skip entire module if not installed
@@ -12,7 +13,6 @@
1213

1314
from lang2sql.integrations.vectorstore.faiss_ import FAISSVectorStore
1415

15-
1616
# ── helpers ──────────────────────────────────────────────────────────────────
1717

1818

tests/test_integrations_pgvector_vectorstore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
TEST_POSTGRES_URL="postgresql://postgres:postgres@localhost:5432/test" \\
99
pytest tests/test_integrations_pgvector_vectorstore.py -v
1010
"""
11+
1112
import os
1213
import pytest
1314
from uuid import uuid4
@@ -19,7 +20,6 @@
1920

2021
from lang2sql.integrations.vectorstore.pgvector_ import PGVectorStore
2122

22-
2323
# ── helpers ──────────────────────────────────────────────────────────────────
2424

2525

0 commit comments

Comments
 (0)