Skip to content

Commit

Permalink
#191: Renamed UDF json element "parameters" to "parameter" (#193)
Browse files Browse the repository at this point in the history
* #191: Renamed UDF json element "parameters" to "parameter"
  • Loading branch information
ckunki authored Oct 11, 2024
1 parent e608398 commit 8c14066
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions doc/changes/changes_0.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions exasol_advanced_analytics_framework/lua/src/query_loop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function M.prepare_init_query(arguments, meta)
local temporary_name_prefix <const> = _generate_temporary_name_prefix(meta)

local query_handler <const> = arguments_with_defaults['query_handler']
local params <const> = query_handler['parameters']
local param <const> = query_handler['parameter']
local factory_class <const> = query_handler["factory_class"]
local factory_class_module <const> = factory_class['module']
local factory_class_name <const> = factory_class['name']
Expand All @@ -64,7 +64,7 @@ function M.prepare_init_query(arguments, meta)
temporary_schema_name,
factory_class_name,
factory_class_module,
params)
param)
local query <const> = string.format("SELECT %s%s", full_qualified_udf_name, udf_args)
return query
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
12 changes: 6 additions & 6 deletions exasol_advanced_analytics_framework/lua/test/test_query_loop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -87,7 +87,7 @@ test_query_loop = {
name = "cls_name",
module = "package.module"
},
parameters = "params"
parameter = "param"
},
},
},
Expand All @@ -101,7 +101,7 @@ test_query_loop = {
schema_name = "temp_schema"
},
query_handler = {
parameters = "params"
parameter = "param"
},
},
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 8c14066

Please sign in to comment.