From 02d45025abb73cc0bc833049402bd87118047c49 Mon Sep 17 00:00:00 2001 From: Runar Ask Johannessen <89020325+equinor-ruaj@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:39:12 +0100 Subject: [PATCH] Default arrow conversion to string type --- src/fmu/sumo/sim2sumo/_special_treatments.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fmu/sumo/sim2sumo/_special_treatments.py b/src/fmu/sumo/sim2sumo/_special_treatments.py index eeb4828..2c9ccdc 100644 --- a/src/fmu/sumo/sim2sumo/_special_treatments.py +++ b/src/fmu/sumo/sim2sumo/_special_treatments.py @@ -26,11 +26,11 @@ def convert_to_arrow(frame): frame["DATE"] = pd.to_datetime(frame["DATE"]) scheme = [] for column_name in frame.columns: - if pd.api.types.is_string_dtype(frame[column_name]): - scheme.append((column_name, pa.string())) + if pd.api.types.is_numeric_dtype(frame[column_name]): + scheme.append((column_name, pa.float32())) else: scheme.append( - (column_name, standard.get(column_name, pa.float32())) + (column_name, standard.get(column_name, pa.string())) ) table = pa.Table.from_pandas(frame, schema=pa.schema(scheme)) return table