Skip to content

Commit

Permalink
rely on psycopg rather than psycopg2
Browse files Browse the repository at this point in the history
  • Loading branch information
zganger committed Nov 19, 2024
1 parent 4123c36 commit b71c929
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/scraper/notebooks/cpdp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"import numpy as np\n",
"import pandas as pd\n",
"import sqlalchemy\n",
"import psycopg2\n",
"import psycopg\n",
"from IPython.display import display, HTML\n",
"from collections import namedtuple\n",
"from backend.database import db, Incident, Officer, Accusation, Victim\n",
Expand Down Expand Up @@ -350,7 +350,7 @@
" try:\n",
" insert_bulk(dicts, OrmClass)\n",
" except sqlalchemy.exc.IntegrityError as e:\n",
" if isinstance(e.orig, psycopg2.errors.UniqueViolation):\n",
" if isinstance(e.orig, psycopg.errors.UniqueViolation):\n",
" print(f\"Already created {OrmClass.__name__} records\")\n",
" else:\n",
" raise e\n",
Expand Down
1 change: 0 additions & 1 deletion backend/scraper/notebooks/mpv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"import numpy as np\n",
"import pandas as pd\n",
"from flask_sqlalchemy import SQLAlchemy\n",
"import psycopg2\n",
"from itertools import zip_longest\n",
"from typing import List\n",
"import requests\n",
Expand Down
2 changes: 1 addition & 1 deletion requirements/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# psycopg2 requires postgres development files in order to compile the
# psycopg requires postgres development files in order to compile the
# requirements, so this image starts with the same image as the database
# containers and installs the same version of python as the api containers

Expand Down

0 comments on commit b71c929

Please sign in to comment.