Skip to content

Commit

Permalink
Fixup to7 migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Sep 30, 2024
1 parent 0d8ddd4 commit c2309fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ert/storage/migration/to7.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ def _migrate_responses_from_netcdf_to_parquet(path: Path) -> None:

pandas_df = gen_data_ds.to_dataframe().dropna()
polars_df = polars.from_pandas(pandas_df.reset_index())
polars_df.rename({"name": "response_key"})

if "time" in polars_df:
polars_df = polars_df.with_columns(
polars.col("time").dt.cast_time_unit("ms")
)

polars_df.write_parquet(real_dir / f"{ds_name}.parquet")

os.remove(real_dir / f"{ds_name}.nc")
Expand Down

0 comments on commit c2309fa

Please sign in to comment.