diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-03 13:57:18 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-03 16:46:07 -0700 |
commit | 5d29d1336afc90d3575a0379a9e9d9bdac8d1856 (patch) | |
tree | c22755cdf2615453ab1f3b7ddaf13becd946a63d /python/fatcat_tools/importers/ingest.py | |
parent | caf1cb316ed18820f3239a285ef14bf45ef963a2 (diff) | |
download | fatcat-5d29d1336afc90d3575a0379a9e9d9bdac8d1856.tar.gz fatcat-5d29d1336afc90d3575a0379a9e9d9bdac8d1856.zip |
typing: relatively simple type check fixes
These mostly add new variable names so that existing variables aren't
overwritten with a new type; delay coercing '{}' or '[]' to 'None' until
the last minute; adding is-not-None checks to conditional clauses; and
similar small changes.
Diffstat (limited to 'python/fatcat_tools/importers/ingest.py')
-rw-r--r-- | python/fatcat_tools/importers/ingest.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/ingest.py b/python/fatcat_tools/importers/ingest.py index e13ce4bd..4f1cc3c4 100644 --- a/python/fatcat_tools/importers/ingest.py +++ b/python/fatcat_tools/importers/ingest.py @@ -642,15 +642,16 @@ class IngestFilesetResultImporter(IngestFileResultImporter): def want_fileset(self, row: Dict[str, Any]) -> bool: - if not row.get("manifest") or len(row.get("manifest")) == 0: + manifest: Optional[List[Any]] = row.get("manifest") + if not manifest or len(manifest) == 0: self.counts["skip-empty-manifest"] += 1 return False - if len(row.get("manifest")) == 1: + if len(manifest) == 1: self.counts["skip-single-file"] += 1 return False - if len(row.get("manifest")) > self.max_file_count: + if len(manifest) > self.max_file_count: self.counts["skip-too-many-files"] += 1 return False |