diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-10-27 18:59:30 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-10-27 18:59:30 -0700 |
commit | 40adf5ed09d917b8a4b8f75680bbf90c147848b3 (patch) | |
tree | 0829f1e4bd09143dd828518de85e6565acfe58e7 /python/sandcrawler/persist.py | |
parent | ee32fa0fba6995f98d2301fdf66ef39229ff49e1 (diff) | |
download | sandcrawler-40adf5ed09d917b8a4b8f75680bbf90c147848b3.tar.gz sandcrawler-40adf5ed09d917b8a4b8f75680bbf90c147848b3.zip |
small type annotation things from additional packages
Diffstat (limited to 'python/sandcrawler/persist.py')
-rw-r--r-- | python/sandcrawler/persist.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/sandcrawler/persist.py b/python/sandcrawler/persist.py index f7954b1..c8c0c33 100644 --- a/python/sandcrawler/persist.py +++ b/python/sandcrawler/persist.py @@ -22,6 +22,8 @@ import os import xml.etree.ElementTree from typing import Any, Dict, List, Optional +import psycopg2 + from sandcrawler.db import SandcrawlerPostgresClient from sandcrawler.grobid import GrobidClient from sandcrawler.ingest_html import HtmlMetaRow @@ -358,7 +360,7 @@ class PersistGrobidWorker(SandcrawlerWorker): assert not (self.s3_only and self.db_only), "Only one of s3_only and db_only allowed" if not self.s3_only: self.db: Optional[SandcrawlerPostgresClient] = SandcrawlerPostgresClient(db_url) - self.cur = self.db.conn.cursor() + self.cur: Optional[psycopg2.extensions.cursor] = self.db.conn.cursor() else: self.db = None self.cur = None @@ -514,7 +516,7 @@ class PersistPdfTextWorker(SandcrawlerWorker): assert not (self.s3_only and self.db_only), "Only one of s3_only and db_only allowed" if not self.s3_only: self.db: Optional[SandcrawlerPostgresClient] = SandcrawlerPostgresClient(db_url) - self.cur = self.db.conn.cursor() + self.cur: Optional[psycopg2.extensions.cursor] = self.db.conn.cursor() else: self.db = None self.cur = None |