aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/cleanups/common.py1
-rw-r--r--python/fatcat_tools/harvest/pubmed.py1
-rw-r--r--python/fatcat_tools/workers/changelog.py1
3 files changed, 3 insertions, 0 deletions
diff --git a/python/fatcat_tools/cleanups/common.py b/python/fatcat_tools/cleanups/common.py
index 7ebfc8a0..4e8e49fd 100644
--- a/python/fatcat_tools/cleanups/common.py
+++ b/python/fatcat_tools/cleanups/common.py
@@ -141,4 +141,5 @@ class EntityCleaner:
)
self._editgroup_id = eg.editgroup_id
+ assert self._editgroup_id
return self._editgroup_id
diff --git a/python/fatcat_tools/harvest/pubmed.py b/python/fatcat_tools/harvest/pubmed.py
index a1b4da0e..118580db 100644
--- a/python/fatcat_tools/harvest/pubmed.py
+++ b/python/fatcat_tools/harvest/pubmed.py
@@ -259,6 +259,7 @@ def generate_date_file_map(host: str = "ftp.ncbi.nlm.nih.gov") -> Dict[str, Any]
filedate,
) = match.groups() # ('pubmed20n1017.xml', 'Tue Dec 17 15:23:32 EST 2019')
date = dateparser.parse(filedate)
+ assert date is not None
fullpath = "/pubmed/updatefiles/{}.gz".format(filename)
date_str = date.strftime("%Y-%m-%d")
mapping[date_str].add(fullpath)
diff --git a/python/fatcat_tools/workers/changelog.py b/python/fatcat_tools/workers/changelog.py
index 8f8efdda..ff358c66 100644
--- a/python/fatcat_tools/workers/changelog.py
+++ b/python/fatcat_tools/workers/changelog.py
@@ -35,6 +35,7 @@ class ChangelogWorker(FatcatWorker):
# topic
if self.offset is None:
print("Checking for most recent changelog offset...")
+ assert self.produce_topic
msg = most_recent_message(self.produce_topic, self.kafka_config)
if msg:
self.offset = json.loads(msg.decode("utf-8"))["index"]