Implement convert_pandas_nullable for pandas nullable boolean dtype

This commit is contained in:
RunasSudo 2022-11-10 18:46:54 +11:00
parent b40f63aa43
commit 040aa2d463
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -74,6 +74,10 @@ def convert_pandas_nullable(df):
if df_cleaned is None: if df_cleaned is None:
df_cleaned = df.copy() df_cleaned = df.copy()
df_cleaned[col] = df[col].astype(str(df[col].dtype).lower()) 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: if df_cleaned is None:
return df return df