omnata-plugin-runtime 0.6.2a166__tar.gz → 0.6.2a168__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/PKG-INFO +1 -1
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/pyproject.toml +1 -1
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/omnata_plugin.py +67 -76
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/LICENSE +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/README.md +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/__init__.py +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/api.py +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/configuration.py +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/forms.py +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/logging.py +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/src/omnata_plugin_runtime/plugin_entrypoints.py +0 -0
- {omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/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.6.2-
|
3
|
+
version = "0.6.2-a168"
|
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"
|
@@ -2397,43 +2397,39 @@ def find_udtf_classes(path:str = '.') -> List[UDTFDefinition]:
|
|
2397
2397
|
matching_classes = []
|
2398
2398
|
|
2399
2399
|
# Iterate over all modules in the current directory
|
2400
|
-
for
|
2401
|
-
#
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
name='CONNECTION_PARAMETERS',
|
2434
|
-
data_type='OBJECT',
|
2435
|
-
description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udtf_obj.params
|
2436
|
-
matching_classes.append(udtf_obj)
|
2400
|
+
for importer, module_name, ispkg in pkgutil.walk_packages(path=[current_dir]):
|
2401
|
+
# Import the module
|
2402
|
+
module = importlib.import_module(module_name)
|
2403
|
+
|
2404
|
+
# Iterate over all members of the module
|
2405
|
+
for name, obj in inspect.getmembers(module, inspect.isclass):
|
2406
|
+
# Check if the class has the specified attribute
|
2407
|
+
if hasattr(obj, '_is_omnata_udtf'):
|
2408
|
+
matching_classes.append(UDTFDefinition(
|
2409
|
+
name=obj._omnata_udtf_name,
|
2410
|
+
language='python',
|
2411
|
+
runtime_version='3.10',
|
2412
|
+
imports=['/app.zip'],
|
2413
|
+
description=obj._omnata_udtf_description,
|
2414
|
+
params=obj._omnata_udtf_params,
|
2415
|
+
result_columns=obj._omnata_udtf_result_columns,
|
2416
|
+
expose_to_consumer=obj._omnata_udtf_expose_to_consumer,
|
2417
|
+
handler=obj.__module__+'.'+obj.__name__
|
2418
|
+
))
|
2419
|
+
# java doesn't use the python decorator, so we need to check for the class directly
|
2420
|
+
for name, obj in inspect.getmembers(module):
|
2421
|
+
# Check if the class has the specified attribute
|
2422
|
+
if isinstance(obj, UDTFDefinition) and cast(UDTFDefinition,obj).language == 'java':
|
2423
|
+
udtf_obj = cast(UDTFDefinition,obj)
|
2424
|
+
if udtf_obj.language == 'java':
|
2425
|
+
# because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
|
2426
|
+
if udtf_obj.expose_to_consumer:
|
2427
|
+
if len(udtf_obj.params) == 0 or udtf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
|
2428
|
+
udtf_obj.params = [SnowflakeFunctionParameter(
|
2429
|
+
name='CONNECTION_PARAMETERS',
|
2430
|
+
data_type='OBJECT',
|
2431
|
+
description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udtf_obj.params
|
2432
|
+
matching_classes.append(udtf_obj)
|
2437
2433
|
|
2438
2434
|
return matching_classes
|
2439
2435
|
|
@@ -2516,44 +2512,39 @@ def find_udf_functions(path:str = '.') -> List[UDFDefinition]:
|
|
2516
2512
|
matching_classes = []
|
2517
2513
|
|
2518
2514
|
# Iterate over all modules in the current directory
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2523
|
-
|
2524
|
-
for
|
2525
|
-
#
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
udf_obj.params = [SnowflakeFunctionParameter(
|
2554
|
-
name='CONNECTION_PARAMETERS',
|
2555
|
-
data_type='OBJECT',
|
2556
|
-
description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udf_obj.params
|
2557
|
-
matching_classes.append(udf_obj)
|
2515
|
+
for importer, module_name, ispkg in pkgutil.walk_packages(path=[current_dir]):
|
2516
|
+
# Import the module
|
2517
|
+
module = importlib.import_module(module_name)
|
2518
|
+
|
2519
|
+
# Iterate over all members of the module
|
2520
|
+
for name, obj in inspect.getmembers(module, inspect.isfunction):
|
2521
|
+
# Check if the class has the specified attribute
|
2522
|
+
if hasattr(obj, '_is_omnata_udf'):
|
2523
|
+
matching_classes.append(UDFDefinition(
|
2524
|
+
name=obj._omnata_udf_name,
|
2525
|
+
language='python',
|
2526
|
+
runtime_version='3.10',
|
2527
|
+
imports=['/app.zip'],
|
2528
|
+
description=obj._omnata_udf_description,
|
2529
|
+
params=obj._omnata_udf_params,
|
2530
|
+
result_data_type=obj._omnata_udf_result_data_type,
|
2531
|
+
expose_to_consumer=obj._omnata_udf_expose_to_consumer,
|
2532
|
+
packages=[],
|
2533
|
+
handler=obj.__module__+'.'+obj.__name__
|
2534
|
+
))
|
2535
|
+
# java doesn't use the python decorator, so we need to check for the class directly
|
2536
|
+
for name, obj in inspect.getmembers(module):
|
2537
|
+
# Check if the class has the specified attribute
|
2538
|
+
if isinstance(obj, UDFDefinition):
|
2539
|
+
udf_obj = cast(UDFDefinition,obj)
|
2540
|
+
if udf_obj.language == 'java':
|
2541
|
+
# because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
|
2542
|
+
if udf_obj.expose_to_consumer:
|
2543
|
+
if len(udf_obj.params) == 0 or udf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
|
2544
|
+
udf_obj.params = [SnowflakeFunctionParameter(
|
2545
|
+
name='CONNECTION_PARAMETERS',
|
2546
|
+
data_type='OBJECT',
|
2547
|
+
description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udf_obj.params
|
2548
|
+
matching_classes.append(udf_obj)
|
2558
2549
|
|
2559
2550
|
return matching_classes
|
File without changes
|
File without changes
|
File without changes
|
{omnata_plugin_runtime-0.6.2a166 → omnata_plugin_runtime-0.6.2a168}/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
|