diff options
author | BonfaceKilz | 2022-04-07 11:38:34 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-04-07 11:54:28 +0300 |
commit | a74fadbc944ab2028527160994dc8fbae9079a75 (patch) | |
tree | 35061426adbc23bb33a654ba60d77d290002d395 | |
parent | b18de873dbead76276ee5077bc8a2afe78f61606 (diff) | |
download | genenetwork3-a74fadbc944ab2028527160994dc8fbae9079a75.tar.gz |
Fix mypy error
-rw-r--r-- | gn3/csvcmp.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gn3/csvcmp.py b/gn3/csvcmp.py index dcfdc98..6ad84ef 100644 --- a/gn3/csvcmp.py +++ b/gn3/csvcmp.py @@ -150,9 +150,9 @@ def parse_csv_column(column: str) -> tuple: """Give a column, for example: 'Header(1)' or 'Header', return the column name i.e the column name outside the brackets, and the ID, the number inside the brackets.""" - id_ = re.search(r"\((\w+)\)", column) + case_attr_id = None name = column.strip() - if id_: - id_ = id_.groups()[0].strip() - name = column.split(f"({id_})")[0].strip() - return (id_, name) + if (id_ := re.search(r"\((\w+)\)", column)): + case_attr_id = id_.groups()[0].strip() + name = column.split(f"({case_attr_id})")[0].strip() + return (case_attr_id, name) |