Skip to content

Commit c6531a5

Browse files
committed
Address review comments
1 parent a165734 commit c6531a5

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

ann_benchmarks/algorithms/pgvector/module.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
1+
"""
2+
This module supports connecting to a PostgreSQL instance and performing vector
3+
indexing and search using the pgvector extension. The default behavior uses
4+
the "ann" value of PostgreSQL user name, password, and database name, as well
5+
as the default host and port values of the psycopg driver.
6+
7+
If PostgreSQL is managed externally, e.g. in a cloud DBaaS environment, the
8+
environment variable overrides listed below are available for setting PostgreSQL
9+
connection parameters:
10+
11+
ANN_BENCHMARKS_PG_USER
12+
ANN_BENCHMARKS_PG_PASSWORD
13+
ANN_BENCHMARKS_PG_DBNAME
14+
ANN_BENCHMARKS_PG_HOST
15+
ANN_BENCHMARKS_PG_PORT
16+
17+
This module starts the PostgreSQL service automatically using the "service"
18+
command. The environment variable ANN_BENCHMARKS_PG_START_SERVICE could be set
19+
to "false" (or e.g. "0" or "no") in order to disable this behavior.
20+
21+
This module will also attempt to create the pgvector extension inside the
22+
target database, if it has not been already created.
23+
"""
24+
125
import subprocess
226
import sys
327
import os
4-
import logging
528

629
import pgvector.psycopg
730
import psycopg
@@ -11,7 +34,6 @@
1134
from ..base.module import BaseANN
1235
from ...util import get_bool_env_var
1336

14-
1537
def get_pg_param_env_var_name(pg_param_name: str) -> str:
1638
return f'ANN_BENCHMARKS_PG_{pg_param_name.upper()}'
1739

@@ -88,7 +110,7 @@ def fit(self, X):
88110
stdout=sys.stdout,
89111
stderr=sys.stderr)
90112
else:
91-
logging.info(
113+
print(
92114
"Assuming that PostgreSQL service is managed externally. "
93115
"Not attempting to start the service.")
94116

0 commit comments

Comments
 (0)