omnata-plugin-runtime 0.5.7a136__tar.gz → 0.5.7a137__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/omnata_plugin.py +24 -13
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/LICENSE +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/README.md +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/configuration.py +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/forms.py +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/logging.py +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/rate_limiting.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "omnata-plugin-runtime"
|
3
|
-
version = "0.5.7-
|
3
|
+
version = "0.5.7-a137"
|
4
4
|
description = "Classes and common runtime components for building and running Omnata Plugins"
|
5
5
|
authors = ["James Weakley <james.weakley@omnata.com>"]
|
6
6
|
readme = "README.md"
|
@@ -2250,21 +2250,25 @@ def consumer_udtf(
|
|
2250
2250
|
result_columns: List[SnowflakeUDTFResultColumn]):
|
2251
2251
|
def class_decorator(cls):
|
2252
2252
|
# Get the original 'process' method from the class
|
2253
|
-
cls._is_omnata_consumer_udtf = True
|
2254
2253
|
original_process = getattr(cls, 'process')
|
2255
2254
|
sig = signature(original_process)
|
2256
2255
|
params = sig.parameters
|
2257
2256
|
if len(params) < 2:
|
2258
2257
|
raise ValueError("The function must have the self parameter, plus at least the mandatory 'connection_parameters' parameter.")
|
2259
2258
|
# Ensure the first argument is mandatory and positional
|
2260
|
-
|
2261
|
-
raise ValueError("The first argument should be 'self' for class methods.")
|
2259
|
+
first_param_name = list(params.keys())[0]
|
2262
2260
|
|
2263
|
-
if
|
2264
|
-
raise ValueError("The
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2261
|
+
if first_param_name != 'self':
|
2262
|
+
raise ValueError(f"The first argument should be 'self', instead it was '{first_param_name}'.")
|
2263
|
+
|
2264
|
+
second_param_name = list(params.keys())[1]
|
2265
|
+
|
2266
|
+
if second_param_name != 'connection_parameters':
|
2267
|
+
raise ValueError(f"The second argument should be 'connection_parameters', instead it was {second_param_name}.")
|
2268
|
+
|
2269
|
+
|
2270
|
+
if params[second_param_name].annotation != ConnectionConfigurationParameters:
|
2271
|
+
raise ValueError(f"The second argument must be a ConnectionConfigurationParameters, instead it was a {params[second_param_name].annotation}.")
|
2268
2272
|
|
2269
2273
|
@wraps(original_process)
|
2270
2274
|
def wrapped_process(self, connection_parameters, *args, **kwargs):
|
@@ -2290,7 +2294,10 @@ def consumer_udtf(
|
|
2290
2294
|
return original_process(self, parameters, *args, **kwargs)
|
2291
2295
|
# Replace the original 'process' method with the wrapped version
|
2292
2296
|
setattr(cls, 'process', wrapped_process)
|
2293
|
-
|
2297
|
+
cls._is_omnata_consumer_udtf = True
|
2298
|
+
cls._omnata_consumer_udtf_description = description
|
2299
|
+
cls._omnata_consumer_udtf_params = params
|
2300
|
+
cls._omnata_consumer_udtf_result_columns = result_columns
|
2294
2301
|
return cls
|
2295
2302
|
|
2296
2303
|
return class_decorator
|
@@ -2325,10 +2332,11 @@ def consumer_udf(
|
|
2325
2332
|
if len(params) == 0:
|
2326
2333
|
raise ValueError("The function must have at least one parameter.")
|
2327
2334
|
# Ensure the first argument is mandatory and positional
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
2335
|
+
first_param_name = list(params.keys())[0]
|
2336
|
+
if first_param_name != 'connection_parameters':
|
2337
|
+
raise ValueError(f"The first argument should be 'connection_parameters', instead it was '{first_param_name}'.")
|
2338
|
+
if params[first_param_name].annotation != ConnectionConfigurationParameters:
|
2339
|
+
raise ValueError(f"The first argument must be a ConnectionConfigurationParameters, instead it was a {params[first_param_name].annotation}.")
|
2332
2340
|
|
2333
2341
|
@wraps(func)
|
2334
2342
|
def wrapper(self, connection_parameters, *args, **kwargs):
|
@@ -2355,6 +2363,9 @@ def consumer_udf(
|
|
2355
2363
|
return func(parameters, *args, **kwargs)
|
2356
2364
|
|
2357
2365
|
wrapper._is_omnata_consumer_udf = True
|
2366
|
+
wrapper._omnata_consumer_udf_description = description
|
2367
|
+
wrapper._omnata_consumer_udf_params = params
|
2368
|
+
wrapper._omnata_consumer_udf_result_data_type = result_data_type
|
2358
2369
|
return wrapper
|
2359
2370
|
|
2360
2371
|
return decorator
|
File without changes
|
File without changes
|
File without changes
|
{omnata_plugin_runtime-0.5.7a136 → omnata_plugin_runtime-0.5.7a137}/src/omnata_plugin_runtime/api.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|