Skip to content

Commit

Permalink
fix: Default arrow conversion to string type (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
equinor-ruaj authored Dec 16, 2024
1 parent e7d6fab commit 54004b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fmu/sumo/sim2sumo/_special_treatments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54004b1

Please sign in to comment.