omnata-plugin-runtime 0.6.1__py3-none-any.whl → 0.6.2a165__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omnata_plugin_runtime/omnata_plugin.py +70 -67
- {omnata_plugin_runtime-0.6.1.dist-info → omnata_plugin_runtime-0.6.2a165.dist-info}/METADATA +1 -1
- {omnata_plugin_runtime-0.6.1.dist-info → omnata_plugin_runtime-0.6.2a165.dist-info}/RECORD +5 -5
- {omnata_plugin_runtime-0.6.1.dist-info → omnata_plugin_runtime-0.6.2a165.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.6.1.dist-info → omnata_plugin_runtime-0.6.2a165.dist-info}/WHEEL +0 -0
@@ -2397,39 +2397,40 @@ 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
|
-
if
|
2428
|
-
udtf_obj.params
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2400
|
+
for root, _, _ in os.walk(current_dir):
|
2401
|
+
for _, module_name, _ in pkgutil.iter_modules([root]):
|
2402
|
+
# Import the module
|
2403
|
+
module = importlib.import_module(module_name)
|
2404
|
+
|
2405
|
+
# Iterate over all members of the module
|
2406
|
+
for name, obj in inspect.getmembers(module, inspect.isclass):
|
2407
|
+
# Check if the class has the specified attribute
|
2408
|
+
if hasattr(obj, '_is_omnata_udtf'):
|
2409
|
+
matching_classes.append(UDTFDefinition(
|
2410
|
+
name=obj._omnata_udtf_name,
|
2411
|
+
language='python',
|
2412
|
+
runtime_version='3.10',
|
2413
|
+
imports=['/app.zip'],
|
2414
|
+
description=obj._omnata_udtf_description,
|
2415
|
+
params=obj._omnata_udtf_params,
|
2416
|
+
result_columns=obj._omnata_udtf_result_columns,
|
2417
|
+
expose_to_consumer=obj._omnata_udtf_expose_to_consumer,
|
2418
|
+
handler=obj.__module__+'.'+obj.__name__
|
2419
|
+
))
|
2420
|
+
# java doesn't use the python decorator, so we need to check for the class directly
|
2421
|
+
for name, obj in inspect.getmembers(module):
|
2422
|
+
# Check if the class has the specified attribute
|
2423
|
+
if isinstance(obj, UDTFDefinition) and cast(UDTFDefinition,obj).language == 'java':
|
2424
|
+
udtf_obj = cast(UDTFDefinition,obj)
|
2425
|
+
if udtf_obj.language == 'java':
|
2426
|
+
# because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
|
2427
|
+
if udtf_obj.expose_to_consumer:
|
2428
|
+
if len(udtf_obj.params) == 0 or udtf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
|
2429
|
+
udtf_obj.params = [SnowflakeFunctionParameter(
|
2430
|
+
name='CONNECTION_PARAMETERS',
|
2431
|
+
data_type='OBJECT',
|
2432
|
+
description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udtf_obj.params
|
2433
|
+
matching_classes.append(udtf_obj)
|
2433
2434
|
|
2434
2435
|
return matching_classes
|
2435
2436
|
|
@@ -2512,39 +2513,41 @@ def find_udf_functions(path:str = '.') -> List[UDFDefinition]:
|
|
2512
2513
|
matching_classes = []
|
2513
2514
|
|
2514
2515
|
# Iterate over all modules in the current directory
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
#
|
2522
|
-
|
2523
|
-
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
#
|
2538
|
-
|
2539
|
-
|
2540
|
-
if
|
2541
|
-
|
2542
|
-
if udf_obj.
|
2543
|
-
if
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2516
|
+
# Walk through the directory tree
|
2517
|
+
for root, _, _ in os.walk(current_dir):
|
2518
|
+
for _, module_name, _ in pkgutil.iter_modules([root]):
|
2519
|
+
# Import the module
|
2520
|
+
module = importlib.import_module(module_name)
|
2521
|
+
|
2522
|
+
# Iterate over all members of the module
|
2523
|
+
for name, obj in inspect.getmembers(module, inspect.isfunction):
|
2524
|
+
# Check if the class has the specified attribute
|
2525
|
+
if hasattr(obj, '_is_omnata_udf'):
|
2526
|
+
matching_classes.append(UDFDefinition(
|
2527
|
+
name=obj._omnata_udf_name,
|
2528
|
+
language='python',
|
2529
|
+
runtime_version='3.10',
|
2530
|
+
imports=['/app.zip'],
|
2531
|
+
description=obj._omnata_udf_description,
|
2532
|
+
params=obj._omnata_udf_params,
|
2533
|
+
result_data_type=obj._omnata_udf_result_data_type,
|
2534
|
+
expose_to_consumer=obj._omnata_udf_expose_to_consumer,
|
2535
|
+
packages=[],
|
2536
|
+
handler=obj.__module__+'.'+obj.__name__
|
2537
|
+
))
|
2538
|
+
# java doesn't use the python decorator, so we need to check for the class directly
|
2539
|
+
for name, obj in inspect.getmembers(module):
|
2540
|
+
# Check if the class has the specified attribute
|
2541
|
+
if isinstance(obj, UDFDefinition):
|
2542
|
+
udf_obj = cast(UDFDefinition,obj)
|
2543
|
+
if udf_obj.language == 'java':
|
2544
|
+
# because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
|
2545
|
+
if udf_obj.expose_to_consumer:
|
2546
|
+
if len(udf_obj.params) == 0 or udf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
|
2547
|
+
udf_obj.params = [SnowflakeFunctionParameter(
|
2548
|
+
name='CONNECTION_PARAMETERS',
|
2549
|
+
data_type='OBJECT',
|
2550
|
+
description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udf_obj.params
|
2551
|
+
matching_classes.append(udf_obj)
|
2549
2552
|
|
2550
2553
|
return matching_classes
|
@@ -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=ZxxrPEAnw9K6rEBlteuD99d-QkcfyC9brcqZ49hUFhs,128972
|
7
7
|
omnata_plugin_runtime/plugin_entrypoints.py,sha256=-mkIpfB_pTl1yDBMmTnioW44RPj-V8dvlhBiU7ekvkQ,27976
|
8
8
|
omnata_plugin_runtime/rate_limiting.py,sha256=JukA0l7x7Klqz2b54mR-poP7NRxpUHgWSGp6h0B8u6Q,25612
|
9
|
-
omnata_plugin_runtime-0.6.
|
10
|
-
omnata_plugin_runtime-0.6.
|
11
|
-
omnata_plugin_runtime-0.6.
|
12
|
-
omnata_plugin_runtime-0.6.
|
9
|
+
omnata_plugin_runtime-0.6.2a165.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
10
|
+
omnata_plugin_runtime-0.6.2a165.dist-info/METADATA,sha256=A5Z319HosHchAwvovZyTAu5a2gQyHpb9XF_FsPy2wsg,1985
|
11
|
+
omnata_plugin_runtime-0.6.2a165.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
12
|
+
omnata_plugin_runtime-0.6.2a165.dist-info/RECORD,,
|
File without changes
|
File without changes
|