Skip to content

Commit

Permalink
Enforce correct dtypes in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Nov 28, 2024
1 parent 83a673a commit 8a5567d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ert/storage/migration/to8.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ def _migrate_responses_from_netcdf_to_parquet(path: Path) -> None:
real_dir / f"{ds_name}.nc", engine="scipy"
)

pandas_df = gen_data_ds.to_dataframe().dropna()
polars_df = polars.from_pandas(pandas_df.reset_index())
pandas_df = gen_data_ds.to_dataframe().dropna().reset_index()
polars_df = polars.from_pandas(
pandas_df,
schema_overrides={
"values": polars.Float32,
"realization": polars.UInt16,
},
)
polars_df = polars_df.rename({"name": "response_key"})

if "time" in polars_df:
Expand Down

0 comments on commit 8a5567d

Please sign in to comment.