From c35d84fbe327bae00361e2e09a56090aa2e3c72f Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 26 Mar 2025 13:08:10 -0500 Subject: Replaces empty strings with None --- scripts/phenotypes_bulk_edit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/phenotypes_bulk_edit.py b/scripts/phenotypes_bulk_edit.py index 6e5d416..0ced2ab 100644 --- a/scripts/phenotypes_bulk_edit.py +++ b/scripts/phenotypes_bulk_edit.py @@ -106,7 +106,10 @@ def read_file(filepath: Path) -> Iterator[str]: count = count + 1 continue - _dict = dict(zip(headers, fields)) + _dict = dict(zip( + headers, + ((None if item.strip() == "" else item.strip()) + for item in fields))) _pheno, _xref = _dict.pop("UniqueIdentifier").split("::") _dict["phenotype_id"] = int(_pheno.split(":")[1]) _dict["xref_id"] = int(_xref.split(":")[1]) -- cgit v1.2.3