From c2309fa5be5bb1a0501fe684a598a93559758a3d Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Mon, 30 Sep 2024 14:58:43 +0200 Subject: [PATCH] Fixup to7 migrations --- src/ert/storage/migration/to7.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ert/storage/migration/to7.py b/src/ert/storage/migration/to7.py index cb34c33942e..dc398300f89 100644 --- a/src/ert/storage/migration/to7.py +++ b/src/ert/storage/migration/to7.py @@ -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")