diff --git a/doc/changes/changes_0.1.0.md b/doc/changes/changes_0.1.0.md index f0da0875..dd3a746f 100644 --- a/doc/changes/changes_0.1.0.md +++ b/doc/changes/changes_0.1.0.md @@ -50,6 +50,7 @@ Code name: * #184: Updated micromamba to the latest version 2.0.0 * #176: Updated usage of `exasol-bucketfs` to new API * #185: Removed directory and script for building SLC AAF +* #191: Renamed UDF json element "parameters" to "parameter" ### Documentation diff --git a/exasol_advanced_analytics_framework/lua/src/query_loop.lua b/exasol_advanced_analytics_framework/lua/src/query_loop.lua index d7be3198..7d628844 100644 --- a/exasol_advanced_analytics_framework/lua/src/query_loop.lua +++ b/exasol_advanced_analytics_framework/lua/src/query_loop.lua @@ -46,7 +46,7 @@ function M.prepare_init_query(arguments, meta) local temporary_name_prefix = _generate_temporary_name_prefix(meta) local query_handler = arguments_with_defaults['query_handler'] - local params = query_handler['parameters'] + local param = query_handler['parameter'] local factory_class = query_handler["factory_class"] local factory_class_module = factory_class['module'] local factory_class_name = factory_class['name'] @@ -64,7 +64,7 @@ function M.prepare_init_query(arguments, meta) temporary_schema_name, factory_class_name, factory_class_module, - params) + param) local query = string.format("SELECT %s%s", full_qualified_udf_name, udf_args) return query end diff --git a/exasol_advanced_analytics_framework/lua/test/test_exasol_tools.lua b/exasol_advanced_analytics_framework/lua/test/test_exasol_tools.lua index 5568d0e1..6206310a 100644 --- a/exasol_advanced_analytics_framework/lua/test/test_exasol_tools.lua +++ b/exasol_advanced_analytics_framework/lua/test/test_exasol_tools.lua @@ -28,7 +28,7 @@ function test_exasol_script_tools.test_parse_arguments_query_correct_with_udf() schema = "UDF_SCHEMA", name = "UDF_NAME" }, - parameters = "params" + parameter = "param" }, } local json_str = json.encode(expected_table) diff --git a/exasol_advanced_analytics_framework/lua/test/test_query_handler_runner.lua b/exasol_advanced_analytics_framework/lua/test/test_query_handler_runner.lua index bed40e45..801113fd 100644 --- a/exasol_advanced_analytics_framework/lua/test/test_query_handler_runner.lua +++ b/exasol_advanced_analytics_framework/lua/test/test_query_handler_runner.lua @@ -21,12 +21,12 @@ test_query_handler_runner = { schema = "UDF_SCHEMA", name = "UDF_NAME" }, - parameters = "params" + parameter = "param" }, }, query = "SELECT UDF_SCHEMA.UDF_NAME(" .. "0,'bfs_conn','directory','db_name_1122334455_1','temp_schema'," .. - "'cls_name','package.module','params')", + "'cls_name','package.module','param')", return_query_result = { { nil }, { nil }, diff --git a/exasol_advanced_analytics_framework/lua/test/test_query_loop.lua b/exasol_advanced_analytics_framework/lua/test/test_query_loop.lua index c1326f0f..b3c39679 100644 --- a/exasol_advanced_analytics_framework/lua/test/test_query_loop.lua +++ b/exasol_advanced_analytics_framework/lua/test/test_query_loop.lua @@ -52,12 +52,12 @@ test_query_loop = { schema = "UDF_SCHEMA", name = "UDF_NAME" }, - parameters = "params" + parameter = "param" }, }, query = "SELECT UDF_SCHEMA.UDF_NAME(" .. "0,'bfs_conn','directory','db_name_1122334455_1','temp_schema'," .. - "'cls_name','package.module','params')" + "'cls_name','package.module','param')" }, correct_without_udf = { args = { @@ -73,12 +73,12 @@ test_query_loop = { name = "cls_name", module = "package.module" }, - parameters = "params" + parameter = "param" }, }, query = "SELECT script_schema.AAF_QUERY_HANDLER_UDF(" .. "0,'bfs_conn','directory','db_name_1122334455_1','temp_schema'," .. - "'cls_name','package.module','params')" + "'cls_name','package.module','param')" }, incorrect_without_udf = { args = { @@ -87,7 +87,7 @@ test_query_loop = { name = "cls_name", module = "package.module" }, - parameters = "params" + parameter = "param" }, }, }, @@ -101,7 +101,7 @@ test_query_loop = { schema_name = "temp_schema" }, query_handler = { - parameters = "params" + parameter = "param" }, }, } diff --git a/exasol_advanced_analytics_framework/resources/outputs/create_query_loop.sql b/exasol_advanced_analytics_framework/resources/outputs/create_query_loop.sql index ad98bc47..811a9df1 100644 --- a/exasol_advanced_analytics_framework/resources/outputs/create_query_loop.sql +++ b/exasol_advanced_analytics_framework/resources/outputs/create_query_loop.sql @@ -501,7 +501,7 @@ function M.prepare_init_query(arguments, meta) local temporary_name_prefix = _generate_temporary_name_prefix(meta) local query_handler = arguments_with_defaults['query_handler'] - local params = query_handler['parameters'] + local param = query_handler['parameter'] local factory_class = query_handler["factory_class"] local factory_class_module = factory_class['module'] local factory_class_name = factory_class['name'] @@ -519,7 +519,7 @@ function M.prepare_init_query(arguments, meta) temporary_schema_name, factory_class_name, factory_class_module, - params) + param) local query = string.format("SELECT %s%s", full_qualified_udf_name, udf_args) return query end 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 2f805234..6338c122 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 @@ -60,7 +60,7 @@ class UDFParameter: temporary_schema_name: Optional[str] = None python_class_name: Optional[str] = None python_class_module: Optional[str] = None - parameters: Optional[str] = None + parameter: Optional[str] = None class QueryHandlerStatus(Enum): @@ -181,7 +181,7 @@ def _get_parameter(self, ctx): temporary_schema_name=ctx[4], python_class_name=ctx[5], python_class_module=ctx[6], - parameters=ctx[7]) + parameter=ctx[7]) else: self.parameter = UDFParameter( iter_num=iter_num, @@ -214,7 +214,7 @@ def _create_state(self) -> QueryHandlerRunnerState: ) module = importlib.import_module(self.parameter.python_class_module) query_handler_factory_class = getattr(module, self.parameter.python_class_name) - query_handler_obj = query_handler_factory_class().create(self.parameter.parameters, context) + query_handler_obj = query_handler_factory_class().create(self.parameter.parameter, context) query_handler_state = QueryHandlerRunnerState( top_level_query_handler_context=context, query_handler=query_handler_obj, 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 3a41e300..4f867cec 100644 --- a/tests/integration_tests/with_db/test_query_loop_integration.py +++ b/tests/integration_tests/with_db/test_query_loop_integration.py @@ -32,7 +32,7 @@ def test_query_loop_integration_with_one_iteration( "schema": schema_name, "name": "AAF_QUERY_HANDLER_UDF" }, - "parameters": TEST_INPUT + "parameter": TEST_INPUT }, "temporary_output": { "bucketfs_location": { @@ -68,7 +68,7 @@ def test_query_loop_integration_with_one_iteration_with_not_released_child_query "schema": schema_name, "name": "AAF_QUERY_HANDLER_UDF" }, - "parameters": TEST_INPUT + "parameter": TEST_INPUT }, "temporary_output": { "bucketfs_location": { @@ -104,7 +104,7 @@ def test_query_loop_integration_with_one_iteration_with_not_released_temporary_o "schema": schema_name, "name": "AAF_QUERY_HANDLER_UDF" }, - "parameters": TEST_INPUT + "parameter": TEST_INPUT }, "temporary_output": { "bucketfs_location": { @@ -151,7 +151,7 @@ def test_query_loop_integration_with_two_iteration( "schema": schema_name, "name": "AAF_QUERY_HANDLER_UDF" }, - "parameters": TEST_INPUT + "parameter": TEST_INPUT }, "temporary_output": { "bucketfs_location": {