aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/ingest.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-02 17:55:15 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-02 17:55:22 -0700
commit6fa2d38be243531747241a3ae602069d507368d9 (patch)
tree7cc81446a97a372640f6a189f09b88fa466e77ce /python/fatcat_tools/importers/ingest.py
parent367b06f64546e4533662017c9dbe72aca175a294 (diff)
downloadfatcat-6fa2d38be243531747241a3ae602069d507368d9.tar.gz
fatcat-6fa2d38be243531747241a3ae602069d507368d9.zip
lint: simple, safe inline lint fixes
'==' vs 'is'; 'not a in b' vs 'a not in b'; etc
Diffstat (limited to 'python/fatcat_tools/importers/ingest.py')
-rw-r--r--python/fatcat_tools/importers/ingest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/fatcat_tools/importers/ingest.py b/python/fatcat_tools/importers/ingest.py
index cb663330..4d4efc0a 100644
--- a/python/fatcat_tools/importers/ingest.py
+++ b/python/fatcat_tools/importers/ingest.py
@@ -78,7 +78,7 @@ class IngestFileResultImporter(EntityImporter):
Sandcrawler ingest-specific part of want(). Generic across file and
webcapture ingest.
"""
- if row.get('hit') != True:
+ if row.get('hit') is not True:
self.counts['skip-hit'] += 1
return False
source = row['request'].get('ingest_request_source')
@@ -178,9 +178,9 @@ class IngestFileResultImporter(EntityImporter):
}
# work around old schema
- if not 'terminal_url' in terminal:
+ if 'terminal_url' not in terminal:
terminal['terminal_url'] = terminal['url']
- if not 'terminal_dt' in terminal:
+ if 'terminal_dt' not in terminal:
terminal['terminal_dt'] = terminal['dt']
# convert CDX-style digits to ISO-style timestamp
@@ -358,7 +358,7 @@ class SavePaperNowFileImporter(IngestFileResultImporter):
self.counts['skip-not-savepapernow'] += 1
return False
- if row.get('hit') != True:
+ if row.get('hit') is not True:
self.counts['skip-hit'] += 1
return False
@@ -459,7 +459,7 @@ class IngestWebResultImporter(IngestFileResultImporter):
for resource in row.get('html_resources', []):
timestamp = resource['timestamp']
- if not "+" in timestamp and not "Z" in timestamp:
+ if "+" not in timestamp and "Z" not in timestamp:
timestamp += "Z"
wc_cdx.append(fatcat_openapi_client.WebcaptureCdxLine(
surt=resource['surt'],
@@ -808,7 +808,7 @@ class SavePaperNowFilesetImporter(IngestFilesetResultImporter):
self.counts['skip-not-savepapernow'] += 1
return False
- if row.get('hit') != True:
+ if row.get('hit') is not True:
self.counts['skip-hit'] += 1
return False