From 934baeeae8cb34622995601507422f9de5be8089 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Mon, 7 Oct 2024 08:28:25 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Nicola Coretti --- .../udf_framework/query_handler_runner_udf.py | 4 +--- .../with_db/fixtures/setup_database_fixture.py | 1 - .../udf_framework/test_query_handler_runner_udf_mock.py | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/exasol_advanced_analytics_framework/udf_framework/query_handler_runner_udf.py b/exasol_advanced_analytics_framework/udf_framework/query_handler_runner_udf.py index 3a93b45..8f036ae 100644 --- a/exasol_advanced_analytics_framework/udf_framework/query_handler_runner_udf.py +++ b/exasol_advanced_analytics_framework/udf_framework/query_handler_runner_udf.py @@ -43,9 +43,7 @@ def upload_via_joblib(location: bfs.path.PathLike, object: Any): joblib.dump(object, temp_file.name) temp_file.flush() temp_file.seek(0) - data = b''.join(temp_file) - # strangely location.write(temp_file) did not write any data to BFS - location.write(data) + location.write(temp_file.read()) def read_via_joblib(location: bfs.path.PathLike) -> Any: diff --git a/tests/integration_tests/with_db/fixtures/setup_database_fixture.py b/tests/integration_tests/with_db/fixtures/setup_database_fixture.py index 1495dda..bf2902c 100644 --- a/tests/integration_tests/with_db/fixtures/setup_database_fixture.py +++ b/tests/integration_tests/with_db/fixtures/setup_database_fixture.py @@ -29,7 +29,6 @@ def deployed_scripts(pyexasol_connection, db_schema_name, language_alias) -> Non @pytest.fixture(scope="module") def database_with_slc( - # pyexasol_connection, deployed_scripts, db_schema_name, bucketfs_connection_factory, diff --git a/tests/unit_tests/udf_framework/test_query_handler_runner_udf_mock.py b/tests/unit_tests/udf_framework/test_query_handler_runner_udf_mock.py index cef0b46..a3f10d9 100644 --- a/tests/unit_tests/udf_framework/test_query_handler_runner_udf_mock.py +++ b/tests/unit_tests/udf_framework/test_query_handler_runner_udf_mock.py @@ -211,10 +211,6 @@ def state_file_exists(iteration: int) -> bool: current = 1 assert not state_file_exists(previous) and state_file_exists(current) - # prev_state_exists = _state_file_exists(0, query_handler_bfs_connection) - # current_state_exists = _state_file_exists(1, query_handler_bfs_connection) - # assert prev_state_exists == False and current_state_exists == True - exa = MockExaEnvironment( metadata=MockMetaData( script_code_wrapper_function=_udf_wrapper,