aboutsummaryrefslogtreecommitdiffstats
path: root/python/sandcrawler/db.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-10-26 17:56:44 -0700
committerBryan Newbold <bnewbold@archive.org>2021-10-26 17:56:44 -0700
commita39e4b864968fa73e475cc40af67203faef5236d (patch)
tree8f8e0546f46f3a368fce4ada45666f6a38b8ece7 /python/sandcrawler/db.py
parentb68cd877cac1d7ca77a8e5055f4f12b70f8190c6 (diff)
downloadsandcrawler-a39e4b864968fa73e475cc40af67203faef5236d.tar.gz
sandcrawler-a39e4b864968fa73e475cc40af67203faef5236d.zip
more progress on type annotations
Diffstat (limited to 'python/sandcrawler/db.py')
-rw-r--r--python/sandcrawler/db.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/sandcrawler/db.py b/python/sandcrawler/db.py
index fed1024..05fedc6 100644
--- a/python/sandcrawler/db.py
+++ b/python/sandcrawler/db.py
@@ -108,7 +108,7 @@ class SandcrawlerPostgresClient:
def commit(self) -> None:
self.conn.commit()
- def _inserts_and_updates(self, resp: List[Tuple[Any]], on_conflict: str) -> Tuple[int, int]:
+ def _inserts_and_updates(self, resp: List[Tuple], on_conflict: str) -> Tuple[int, int]:
resp_codes = [int(r[0]) for r in resp]
inserts = len([r for r in resp_codes if r == 0])
if on_conflict == "update":
@@ -231,7 +231,7 @@ class SandcrawlerPostgresClient:
def insert_pdf_meta(self,
cur: psycopg2.extensions.cursor,
- rows: List[Tuple[Any]],
+ rows: List[Tuple],
on_conflict: str = "nothing") -> Tuple[int, int]:
"""
batch elements are expected to have .to_sql_tuple() method
@@ -271,7 +271,7 @@ class SandcrawlerPostgresClient:
def insert_html_meta(self,
cur: psycopg2.extensions.cursor,
- rows: List[Tuple[Any]],
+ rows: List[Tuple],
on_conflict: str = "nothing") -> Tuple[int, int]:
"""
batch elements are expected to have .to_sql_tuple() method