File tree 3 files changed +40
-15
lines changed
3 files changed +40
-15
lines changed Original file line number Diff line number Diff line change 2
2
from datetime import datetime
3
3
from typing import Dict
4
4
5
- import psycopg2
5
+ import pg8000
6
6
7
7
from hunter .analysis import ChangePoint
8
8
from hunter .test_config import PostgresTestConfig
@@ -29,9 +29,9 @@ class Postgres:
29
29
def __init__ (self , config : PostgresConfig ):
30
30
self .__config = config
31
31
32
- def __get_conn (self ) -> psycopg2 . extensions . connection :
32
+ def __get_conn (self ) -> pg8000 . dbapi . Connection :
33
33
if self .__conn is None :
34
- self .__conn = psycopg2 . connect (
34
+ self .__conn = pg8000 . dbapi . Connection (
35
35
host = self .__config .hostname ,
36
36
port = self .__config .port ,
37
37
user = self .__config .username ,
@@ -43,7 +43,7 @@ def __get_conn(self) -> psycopg2.extensions.connection:
43
43
def fetch_data (self , query : str ):
44
44
cursor = self .__get_conn ().cursor ()
45
45
cursor .execute (query )
46
- columns = [c . name for c in cursor .description ]
46
+ columns = [c [ 0 ] for c in cursor .description ]
47
47
return (columns , cursor .fetchall ())
48
48
49
49
def insert_change_point (
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ expandvars = "^0.6.5"
10
10
numpy = " 1.24"
11
11
python = " >=3.8,<3.13"
12
12
python-dateutil = " ^2.8.1"
13
- psycopg2-binary = " ^2.9.3"
14
13
signal-processing-algorithms = " ^1.3.2"
15
14
"ruamel.yaml" = " =0.17.21"
16
15
requests = " ^2.25.1"
@@ -19,6 +18,7 @@ tabulate = "^0.8.7"
19
18
validators = " ^0.18.2"
20
19
slack-sdk = " ^3.4.2"
21
20
google-cloud-bigquery = " ^3.25.0"
21
+ pg8000 = " ^1.31.2"
22
22
23
23
24
24
[tool .poetry .dev-dependencies ]
You can’t perform that action at this time.
0 commit comments