From a1c3d468cdc1ca9141a2cd16222644d4831324a4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 12 Aug 2020 16:22:21 -0700 Subject: handle small ints better (signed/unsigned abs size) --- fatcat_scholar/schema.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fatcat_scholar') 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: -- cgit v1.2.3