From e875bbf49db156ecd556ef346c7167e696d6f734 Mon Sep 17 00:00:00 2001 From: Runar Ask Johannessen <89020325+equinor-ruaj@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:15:38 +0100 Subject: [PATCH] fix: set correct column names in split table metatadata (#132) * fix: set correct column names in split table metatadata * Update tests --- src/fmu/sumo/sim2sumo/tables.py | 2 +- tests/test_functions.py | 2 +- tests/test_with_ert.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fmu/sumo/sim2sumo/tables.py b/src/fmu/sumo/sim2sumo/tables.py index fabd35e..ea4da70 100644 --- a/src/fmu/sumo/sim2sumo/tables.py +++ b/src/fmu/sumo/sim2sumo/tables.py @@ -143,7 +143,7 @@ def convert_table_2_sumo_file(datafile, obj, tagname, config): md5_hex = hashlib.md5(bytestring).hexdigest() md5_b64 = base64.b64encode(bytes.fromhex(md5_hex)).decode() - chunk_meta["data"]["spec"]["columns"] = columns + chunk_meta["data"]["spec"]["columns"] = table.columns chunk_meta["data"]["spec"]["num_columns"] = table.num_columns chunk_meta["data"]["spec"]["num_rows"] = table.num_rows chunk_meta["data"]["spec"]["size"] = ( diff --git a/tests/test_functions.py b/tests/test_functions.py index 747c3b0..0155834 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -282,7 +282,7 @@ def test_upload_tables_from_simulation_run( monkeypatch.chdir(scratch_files[0]) disp = Dispatcher(scratch_files[1], "dev") - expected_results = 3 + expected_results = 2 tables.upload_tables_from_simulation_run( REEK_DATA_FILE, {"summary": {"arrow": True}, "rft": {"arrow": True}}, diff --git a/tests/test_with_ert.py b/tests/test_with_ert.py index 1285f89..f7113e4 100644 --- a/tests/test_with_ert.py +++ b/tests/test_with_ert.py @@ -54,7 +54,7 @@ def test_sim2sumo_with_ert( real0 = ert_run_scratch_files[0] # ! This changes files in the current directory and deletes parameters.txt write_ert_config_and_run(real0) - expected_exports = 90 + expected_exports = 88 path = f"/objects('{ert_run_case_uuid}')/search" results = sumo.post( path,