From 5894ac377c04b4af187309b132c132ff216bb571 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 4 Sep 2025 20:00:31 +0100 Subject: Raise exception if data frame to be written has NA values. This should never occur, but can occur due to bugs in the code; we wish to protect against that. --- pyhegp/serialization.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyhegp/serialization.py b/pyhegp/serialization.py index c197bf2..db1360a 100644 --- a/pyhegp/serialization.py +++ b/pyhegp/serialization.py @@ -108,6 +108,8 @@ def read_phenotype(file): return df def write_tsv(file, df): + if df.isna().any(axis=None): + raise ValueError("Data frame has NA values") df.to_csv(file, quoting=csv.QUOTE_NONE, sep="\t", -- cgit 1.4.1