From 829c4806e74e443d4d3077f0d1eb894681a049e2 Mon Sep 17 00:00:00 2001 From: ckunki Date: Mon, 23 Sep 2024 15:43:24 +0200 Subject: [PATCH] Fixed Build --- exasol_advanced_analytics_framework/slc.py | 2 +- .../udf_framework/query_handler_runner_udf.py | 2 ++ pyproject.toml | 3 ++- tests/integration_tests/with_db/conftest.py | 1 + .../with_db/fixtures/setup_database_fixture.py | 15 ++++++++++++++- .../with_db/test_query_loop_integration.py | 4 ---- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/exasol_advanced_analytics_framework/slc.py b/exasol_advanced_analytics_framework/slc.py index 2e7f0d50..0727aa68 100644 --- a/exasol_advanced_analytics_framework/slc.py +++ b/exasol_advanced_analytics_framework/slc.py @@ -51,7 +51,7 @@ def custom_slc_builder() -> LanguageContainerBuilder: project_directory = find_path_backwards("pyproject.toml", __file__).parent with IncrementalSlcBuilder( # LanguageContainerBuilder container_name="exasol_advanced_analytics_framework_container", - language_alias="PYTHON3_AAF", + language_alias="PYTHON3_AAF", # removed in PEC version 0.5.0 ) as builder: builder.prepare_flavor(project_directory) yield builder 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 ce8e3ee9..de044f6a 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 @@ -173,6 +173,8 @@ def _get_parameter(self, ctx): def _create_bucketfs_location(self): bucketfs_connection_obj = self.exa.get_connection(self.parameter.temporary_bfs_location_conn) + # causes IndexError: tuple index out of range + # in bucket_name = url_path.parts[1], bucketfs_location_from_con = BucketFSFactory().create_bucketfs_location( url=bucketfs_connection_obj.address, user=bucketfs_connection_obj.user, diff --git a/pyproject.toml b/pyproject.toml index ee6fad44..4f8bbff3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,8 @@ polyfactory = "^2.8.0" pytest-repeat = ">=0.9.1" elasticsearch = "^8.6.1" exasol-toolbox = ">=0.14.0" -exasol-python-extension-common = ">=0.4.0" +# 0.5.0 is available but includes a breaking change regarding the interface of LanguageContainerBuilder +exasol-python-extension-common = ">=0.4.0,<0.5.0" exasol-script-languages-container-tool = "<1.0.0" pytest-exasol-slc = ">=0.1.0" pytest-exasol-backend = ">=0.3.0" diff --git a/tests/integration_tests/with_db/conftest.py b/tests/integration_tests/with_db/conftest.py index 1066551f..b9324511 100644 --- a/tests/integration_tests/with_db/conftest.py +++ b/tests/integration_tests/with_db/conftest.py @@ -22,6 +22,7 @@ def slc_builder(use_onprem, use_saas) -> LanguageContainerBuilder: import exasol.bucketfs as bfs from exasol.python_extension_common.deployment.language_container_deployer import LanguageContainerDeployer +# from pytest-plugins/pytest-slc/exasol/pytest_slc/__init__.py BFS_CONTAINER_DIRECTORY = 'container' # can be removed as soon as the following issues is fixed and # a new version of PYTSLC is released 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 cf372c17..f9910f7b 100644 --- a/tests/integration_tests/with_db/fixtures/setup_database_fixture.py +++ b/tests/integration_tests/with_db/fixtures/setup_database_fixture.py @@ -53,12 +53,25 @@ def _deploy_scripts(db_conn) -> None: # 'pat': saas_pat # } + +def _bucket_address(bucketfs_params) -> str: + # pytest-plugins/pytest-slc/exasol/pytest_slc/__init__.py defines + BFS_CONTAINER_DIRECTORY = 'container' + host_and_port = bucketfs_params["url"] + bucket_name = bucketfs_params["bucket_name"] + path_in_bucket = BFS_CONTAINER_DIRECTORY + service_name = bucketfs_params["service_name"] + return ( f"http://{host_and_port}/{bucket_name}/" + f"{path_in_bucket};{service_name}" ) + + def _create_bucketfs_connection(use_onprem, db_conn, bucketfs_params) -> str: name = BUCKETFS_CONNECTION_NAME if use_onprem: # In general currently I disabled SaaS backend for AAF. # Question: Should/Could this work for SaaS, too? - uri = bucketfs_params["url"] + uri = _bucket_address(bucketfs_params) + # uri = bucketfs_params["url"] user = bucketfs_params["username"] pwd = bucketfs_params["password"] db_conn.execute( diff --git a/tests/integration_tests/with_db/test_query_loop_integration.py b/tests/integration_tests/with_db/test_query_loop_integration.py index 65b3c9de..e0e07bee 100644 --- a/tests/integration_tests/with_db/test_query_loop_integration.py +++ b/tests/integration_tests/with_db/test_query_loop_integration.py @@ -199,7 +199,3 @@ def test_query_loop_integration_with_two_iteration( and select_queries_from_query_handler == expected_query_list \ and view_cleanup_query, \ f"Not all required queries where executed {executed_queries}" - - -def test_x(database_with_slc): - pass