Skip to content

Commit

Permalink
Update usages of psycopg2 to psycopg
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb committed Nov 13, 2024
1 parent 8e62829 commit 3451ac4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions indexer_worker/indexer_worker/db_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
from typing import NamedTuple

import psycopg2
import psycopg
from decouple import config


Expand Down Expand Up @@ -43,10 +43,10 @@ def database_connect(
"""
while True:
try:
conn = psycopg2.connect(**dbconfig._asdict(), connect_timeout=timeout)
conn = psycopg.connect(**dbconfig._asdict(), connect_timeout=timeout)
if autocommit:
conn.set_session(autocommit=True)
except psycopg2.OperationalError as e:
except psycopg.OperationalError as e:
if not attempt_reconnect:
return None
log.exception(e)
Expand Down
2 changes: 1 addition & 1 deletion indexer_worker/indexer_worker/queries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from psycopg2.sql import SQL, Identifier, Literal
from psycopg.sql import SQL, Identifier, Literal


def get_existence_queries(model_name: str, table_name: str) -> tuple[SQL, SQL]:
Expand Down

0 comments on commit 3451ac4

Please sign in to comment.