diff --git a/src/ert/storage/migration/to7.py b/src/ert/storage/migration/to7.py index 0c81c7cd1dd..a7a0b6569d0 100644 --- a/src/ert/storage/migration/to7.py +++ b/src/ert/storage/migration/to7.py @@ -240,6 +240,15 @@ def _migrate_responses_from_netcdf_to_parquet(path: Path) -> None: polars.col("time").dt.cast_time_unit("ms") ) + # Ensure "response_key" is the first column + polars_df = polars_df.select( + ["response_key"] + + [ + col + for col in polars_df.columns + if col != "response_key" + ] + ) polars_df.write_parquet(real_dir / f"{ds_name}.parquet") os.remove(real_dir / f"{ds_name}.nc")