diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 99c8a8e6b..40d392d24 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,26 +11,26 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: check-added-large-files - - repo: https://github.com/psf/black - rev: 24.10.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black name: "Black: The uncompromising Python code formatter" - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 8.0.1 hooks: - id: isort name: "Sort Imports" args: ["--profile", "black"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.15.9 hooks: # Run the linter. - id: ruff diff --git a/dataset_reader/sparse_reader.py b/dataset_reader/sparse_reader.py index 51beecaf2..6f35c49ab 100644 --- a/dataset_reader/sparse_reader.py +++ b/dataset_reader/sparse_reader.py @@ -8,7 +8,7 @@ def read_sparse_matrix_fields( - filename: Union[Path, str] + filename: Union[Path, str], ) -> Tuple[np.array, np.array, np.array]: """Read the fields of a CSR matrix without instantiating it""" @@ -68,7 +68,7 @@ def read_csr_matrix(filename: Union[Path, str], do_mmap=True) -> Iterator[Sparse def knn_result_read( - filename: Union[Path, str] + filename: Union[Path, str], ) -> Tuple[List[List[int]], List[List[float]]]: n, d = map(int, np.fromfile(filename, dtype="uint32", count=2)) assert os.stat(filename).st_size == 8 + n * d * (4 + 4) diff --git a/engine/clients/pgvector/configure.py b/engine/clients/pgvector/configure.py index 5833277c2..a3188385e 100644 --- a/engine/clients/pgvector/configure.py +++ b/engine/clients/pgvector/configure.py @@ -25,12 +25,10 @@ def recreate(self, dataset: Dataset, collection_params): if dataset.config.distance == Distance.DOT: raise IncompatibilityError - self.conn.execute( - f"""CREATE TABLE items ( + self.conn.execute(f"""CREATE TABLE items ( id SERIAL PRIMARY KEY, embedding vector({dataset.config.vector_size}) NOT NULL - );""" - ) + );""") self.conn.execute("ALTER TABLE items ALTER COLUMN embedding SET STORAGE PLAIN") def delete_client(self):