omnata-plugin-runtime 0.5.7a131__py3-none-any.whl → 0.5.7a133__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omnata_plugin_runtime/omnata_plugin.py +7 -52
- {omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/METADATA +1 -1
- {omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/RECORD +5 -5
- {omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/WHEEL +0 -0
@@ -2242,38 +2242,15 @@ def consumer_udtf(param_docs: Dict[str, Dict[str, Any]]):
|
|
2242
2242
|
|
2243
2243
|
if list(params.keys())[1] != 'connection_parameters':
|
2244
2244
|
raise ValueError("The second argument should be 'connection_parameters'.")
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2248
|
-
name: (param.annotation, param_docs.get(name, {}).get("default", param.default))
|
2249
|
-
for name, param in params.items()
|
2250
|
-
if name != 'cls' and name != 'connection_parameters'
|
2251
|
-
}
|
2252
|
-
|
2253
|
-
DynamicModel = create_model('DynamicModel', **fields)
|
2254
|
-
|
2255
|
-
# Attach the documentation to the function
|
2256
|
-
original_process.__doc__ = original_process.__doc__ or ""
|
2257
|
-
original_process.__doc__ += "\n\nArgs:\n"
|
2258
|
-
for name, param in params.items():
|
2259
|
-
if name != 'self':
|
2260
|
-
doc = param_docs.get(name, {})
|
2261
|
-
original_process.__doc__ += f" {name} ({param.annotation.__name__}): {doc.get('description', 'No description provided.')}\n"
|
2245
|
+
|
2246
|
+
if params[list(params.keys())[1]].annotation != Dict:
|
2247
|
+
raise ValueError("The second argument must be a dict.")
|
2262
2248
|
|
2263
2249
|
@wraps(original_process)
|
2264
2250
|
def wrapped_process(self, connection_parameters, *args, **kwargs):
|
2265
2251
|
if connection_parameters is None:
|
2266
2252
|
raise ValueError("Connection not found")
|
2267
|
-
|
2268
|
-
if not isinstance(connection_parameters, Dict):
|
2269
|
-
raise ValueError("The first argument must be an object, the result of calling PLUGIN_CONNECTION.")
|
2270
2253
|
|
2271
|
-
try:
|
2272
|
-
# Validate the arguments using the dynamic Pydantic model
|
2273
|
-
validated_args = DynamicModel(**kwargs)
|
2274
|
-
except ValidationError as e:
|
2275
|
-
raise ValueError(f"Argument validation error: {e}")
|
2276
|
-
|
2277
2254
|
# convert the connection parameters dictionary to a ConnectionConfigurationParameters object which includes the real secrets
|
2278
2255
|
if 'other_secrets_name' in connection_parameters:
|
2279
2256
|
# this is the new way, where the sync engine only passes the name of the secret
|
@@ -2290,7 +2267,7 @@ def consumer_udtf(param_docs: Dict[str, Dict[str, Any]]):
|
|
2290
2267
|
parameters = ConnectionConfigurationParameters.model_validate(connection_parameters)
|
2291
2268
|
|
2292
2269
|
# Pass the validated arguments to the function
|
2293
|
-
return original_process(self, parameters, *args, **
|
2270
|
+
return original_process(self, parameters, *args, **kwargs)
|
2294
2271
|
# Replace the original 'process' method with the wrapped version
|
2295
2272
|
setattr(cls, 'process', wrapped_process)
|
2296
2273
|
|
@@ -2325,37 +2302,15 @@ def consumer_udf(param_docs: Dict[str, Dict[str, Any]]):
|
|
2325
2302
|
# Ensure the first argument is mandatory and positional
|
2326
2303
|
if list(params.keys())[0] != 'connection_parameters':
|
2327
2304
|
raise ValueError("The first argument should be 'connection_parameters'.")
|
2328
|
-
|
2329
|
-
|
2330
|
-
fields = {
|
2331
|
-
name: (param.annotation, param_docs.get(name, {}).get("default", param.default))
|
2332
|
-
for name, param in params.items()
|
2333
|
-
if name != 'connection_parameters'
|
2334
|
-
}
|
2335
|
-
|
2336
|
-
DynamicModel = create_model('DynamicModel', **fields)
|
2337
|
-
|
2338
|
-
# Attach the documentation to the function
|
2339
|
-
func.__doc__ = func.__doc__ or ""
|
2340
|
-
func.__doc__ += "\n\nArgs:\n"
|
2341
|
-
for name, param in params.items():
|
2342
|
-
doc = param_docs.get(name, {})
|
2343
|
-
func.__doc__ += f" {name} ({param.annotation.__name__}): {doc.get('description', 'No description provided.')}\n"
|
2305
|
+
if params[list(params.keys())[0]].annotation != Dict:
|
2306
|
+
raise ValueError("The first argument must be a dict.")
|
2344
2307
|
|
2345
2308
|
@wraps(func)
|
2346
2309
|
def wrapper(self, connection_parameters, *args, **kwargs):
|
2347
2310
|
if connection_parameters is None:
|
2348
2311
|
raise ValueError("Connection not found")
|
2349
2312
|
|
2350
|
-
if not isinstance(connection_parameters, Dict):
|
2351
|
-
raise ValueError("The first argument must be an object, the result of calling PLUGIN_CONNECTION.")
|
2352
2313
|
|
2353
|
-
try:
|
2354
|
-
# Validate the arguments using the dynamic Pydantic model
|
2355
|
-
validated_args = DynamicModel(**kwargs)
|
2356
|
-
except ValidationError as e:
|
2357
|
-
raise ValueError(f"Argument validation error: {e}")
|
2358
|
-
|
2359
2314
|
# convert the connection parameters dictionary to a ConnectionConfigurationParameters object which includes the real secrets
|
2360
2315
|
if 'other_secrets_name' in connection_parameters:
|
2361
2316
|
# this is the new way, where the sync engine only passes the name of the secret
|
@@ -2372,7 +2327,7 @@ def consumer_udf(param_docs: Dict[str, Dict[str, Any]]):
|
|
2372
2327
|
parameters = ConnectionConfigurationParameters.model_validate(connection_parameters)
|
2373
2328
|
|
2374
2329
|
# Pass the validated arguments to the function
|
2375
|
-
return func(parameters, *args, **
|
2330
|
+
return func(parameters, *args, **kwargs)
|
2376
2331
|
|
2377
2332
|
wrapper._is_omnata_consumer_udf = True
|
2378
2333
|
return wrapper
|
{omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/RECORD
RENAMED
@@ -3,10 +3,10 @@ omnata_plugin_runtime/api.py,sha256=FxzTqri4no8ClkOm7vZADG8aD47jcGBCTTQDEORmOJM,
|
|
3
3
|
omnata_plugin_runtime/configuration.py,sha256=TI6GaVFhewVawBCaYN34GujY57qEP6q2nik4YpSEk5s,38100
|
4
4
|
omnata_plugin_runtime/forms.py,sha256=GzSPEwcijsoPCXEO1mHiE8ylvX_KSE5TkhwqkymA2Ss,19755
|
5
5
|
omnata_plugin_runtime/logging.py,sha256=bn7eKoNWvtuyTk7RTwBS9UARMtqkiICtgMtzq3KA2V0,3272
|
6
|
-
omnata_plugin_runtime/omnata_plugin.py,sha256=
|
6
|
+
omnata_plugin_runtime/omnata_plugin.py,sha256=yY2f5xE0VnzfGiL8CGyje_rVbZmCMgm6NYiaWxt-N1k,116805
|
7
7
|
omnata_plugin_runtime/plugin_entrypoints.py,sha256=PFSLsYEVnWHVvSoOYTtTK2JY6pp6_8_eYP53WqLRiPE,27975
|
8
8
|
omnata_plugin_runtime/rate_limiting.py,sha256=DVQ_bc-mVLBkrU1PTns1MWXhHiLpSB5HkWCcdePtJ2A,25611
|
9
|
-
omnata_plugin_runtime-0.5.
|
10
|
-
omnata_plugin_runtime-0.5.
|
11
|
-
omnata_plugin_runtime-0.5.
|
12
|
-
omnata_plugin_runtime-0.5.
|
9
|
+
omnata_plugin_runtime-0.5.7a133.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
10
|
+
omnata_plugin_runtime-0.5.7a133.dist-info/METADATA,sha256=hR1rJW54yER8oVdKnh8VddCA_iRFGVWVAl9VaEfCd3M,1985
|
11
|
+
omnata_plugin_runtime-0.5.7a133.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
+
omnata_plugin_runtime-0.5.7a133.dist-info/RECORD,,
|
{omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/LICENSE
RENAMED
File without changes
|
{omnata_plugin_runtime-0.5.7a131.dist-info → omnata_plugin_runtime-0.5.7a133.dist-info}/WHEEL
RENAMED
File without changes
|