aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/transforms
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/transforms
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/transforms')
-rw-r--r--python/fatcat_tools/transforms/elasticsearch.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py
index bfc18f83..ec5891c3 100644
--- a/python/fatcat_tools/transforms/elasticsearch.py
+++ b/python/fatcat_tools/transforms/elasticsearch.py
@@ -1,6 +1,6 @@
import datetime
-from typing import Dict, List, Any, Optional
+from typing import Dict, Any, Optional
import tldextract
@@ -166,7 +166,7 @@ def release_to_elasticsearch(entity: ReleaseEntity, force_bool: bool = True) ->
if extra.get('is_oa'):
# NOTE: not actually setting this anywhere... but could
t['is_oa'] = True
- if extra.get('is_work_alias') != None:
+ if extra.get('is_work_alias') is not None:
t['is_work_alias'] = bool(extra.get('is_work_alias'))
if extra.get('longtail_oa'):
# sometimes set by GROBID/matcher
@@ -214,7 +214,7 @@ def release_to_elasticsearch(entity: ReleaseEntity, force_bool: bool = True) ->
for k in ('crossref', 'datacite', 'jalc'):
if k in extra:
t['doi_registrar'] = k
- if not 'doi_registrar' in t:
+ if 'doi_registrar' not in t:
t['doi_registrar'] = 'crossref'
if t['doi']:
@@ -511,12 +511,12 @@ def container_to_elasticsearch(entity, force_bool=True, stats=None):
def _type_of_edit(edit: EntityEdit) -> str:
- if edit.revision == None and edit.redirect_ident == None:
+ if edit.revision is None and edit.redirect_ident is None:
return 'delete'
elif edit.redirect_ident:
# redirect
return 'update'
- elif edit.prev_revision == None and edit.redirect_ident == None and edit.revision:
+ elif edit.prev_revision is None and edit.redirect_ident is None and edit.revision:
return 'create'
else:
return 'update'