From 54004b1d44e95980667d06e53beb98a35bd50f50 Mon Sep 17 00:00:00 2001 From: Runar Ask Johannessen <89020325+equinor-ruaj@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:01:33 +0100 Subject: [PATCH] fix: Default arrow conversion to string type (#122) --- 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