From 040aa2d463a4d3e93a80160ee27f2d4e03912dba Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Thu, 10 Nov 2022 18:46:54 +1100 Subject: [PATCH] Implement convert_pandas_nullable for pandas nullable boolean dtype --- yli/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yli/utils.py b/yli/utils.py index d413f3f..937a36b 100644 --- a/yli/utils.py +++ b/yli/utils.py @@ -74,6 +74,10 @@ def convert_pandas_nullable(df): if df_cleaned is None: df_cleaned = df.copy() df_cleaned[col] = df[col].astype(str(df[col].dtype).lower()) + elif df[col].dtype == 'boolean': + if df_cleaned is None: + df_cleaned = df.copy() + df_cleaned[col] = df[col].astype('bool') if df_cleaned is None: return df