summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-08-12 16:22:21 -0700
committerBryan Newbold <bnewbold@archive.org>2020-08-12 16:22:21 -0700
commita1c3d468cdc1ca9141a2cd16222644d4831324a4 (patch)
treee1738eeeacd3efca7b6acfc34b47d55d85f2fae6
parent4c157374f480137a64edaa672a7aff8c0dad314f (diff)
downloadfatcat-scholar-a1c3d468cdc1ca9141a2cd16222644d4831324a4.tar.gz
fatcat-scholar-a1c3d468cdc1ca9141a2cd16222644d4831324a4.zip
handle small ints better (signed/unsigned abs size)
-rw-r--r--fatcat_scholar/schema.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py
index 5a5b339..3d402b4 100644
--- a/fatcat_scholar/schema.py
+++ b/fatcat_scholar/schema.py
@@ -182,7 +182,7 @@ def clean_small_int(raw: Optional[str]) -> Optional[int]:
if not raw or not raw.isdigit():
return None
val = int(raw)
- if abs(val) > 50000:
+ if abs(val) > 30000:
return None
return val
@@ -195,6 +195,7 @@ def test_clean_small_int() -> None:
assert clean_small_int("123") == 123
assert clean_small_int("1200003") == None
assert clean_small_int("-123") == None
+ assert clean_small_int("48844") == None
def doi_split_prefix(doi: str) -> str: