Skip to content

Commit 3fef4ac

Browse files
committed
update with statistics
1 parent 93efc87 commit 3fef4ac

2 files changed

Lines changed: 15 additions & 17 deletions

File tree

pyepsilla/cloud/client.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_db_info(self, db_id: str):
6161
res.close()
6262
return status_code, body
6363

64-
def get_db_statistics(self):
64+
def get_db_statistics(self, db_id: str):
6565
req_url = "{}/vectordb/{}/statistics".format(self._baseurl, db_id)
6666
req_data = None
6767
res = requests.get(
@@ -98,7 +98,14 @@ def vectordb(self, db_id: str):
9898

9999

100100
class Vectordb(Client):
101-
def __init__(self, project_id: str, db_id: str, api_key: str, public_endpoint: str, headers: dict = None):
101+
def __init__(
102+
self,
103+
project_id: str,
104+
db_id: str,
105+
api_key: str,
106+
public_endpoint: str,
107+
headers: dict = None,
108+
):
102109
self._project_id = project_id
103110
self._db_id = db_id
104111
self._api_key = api_key
@@ -122,7 +129,12 @@ def list_tables(self):
122129
return status_code, body
123130

124131
# Create table
125-
def create_table(self, table_name: str, table_fields: list[dict] = None, indices: list[dict] = None):
132+
def create_table(
133+
self,
134+
table_name: str,
135+
table_fields: list[dict] = None,
136+
indices: list[dict] = None,
137+
):
126138
if self._db_id is None:
127139
raise Exception("[ERROR] db_id is None!")
128140
if table_fields is None:

pyepsilla/vectordb/client.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def statistics(self):
119119
res.close()
120120
return status_code, body
121121

122-
123122
def create_table(
124123
self,
125124
table_name: str,
@@ -316,19 +315,6 @@ def get(
316315
res.close()
317316
return status_code, body
318317

319-
def statistics(self):
320-
if self._db is None:
321-
raise Exception("[ERROR] Please use_db() first!")
322-
req_url = "{}/api/{}/statistics".format(self._baseurl, self._db)
323-
req_data = None
324-
res = requests.get(
325-
url=req_url, data=json.dumps(req_data), headers=self._header, verify=False
326-
)
327-
status_code = res.status_code
328-
body = res.json()
329-
res.close()
330-
return status_code, body
331-
332318
def drop_table(self, table_name: str = None):
333319
if self._db is None:
334320
raise Exception("[ERROR] Please use_db() first!")

0 commit comments

Comments
 (0)