omnata-plugin-runtime 0.6.1a164__py3-none-any.whl → 0.6.2a166__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.
@@ -2397,39 +2397,43 @@ 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 _, module_name, _ in pkgutil.iter_modules([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)
2400
+ for root, _, _ in os.walk(current_dir):
2401
+ # exclude the '.packages' directory
2402
+ if '.packages' in root:
2403
+ continue
2404
+ for _, module_name, _ in pkgutil.iter_modules([root]):
2405
+ # Import the module
2406
+ module = importlib.import_module(module_name)
2407
+
2408
+ # Iterate over all members of the module
2409
+ for name, obj in inspect.getmembers(module, inspect.isclass):
2410
+ # Check if the class has the specified attribute
2411
+ if hasattr(obj, '_is_omnata_udtf'):
2412
+ matching_classes.append(UDTFDefinition(
2413
+ name=obj._omnata_udtf_name,
2414
+ language='python',
2415
+ runtime_version='3.10',
2416
+ imports=['/app.zip'],
2417
+ description=obj._omnata_udtf_description,
2418
+ params=obj._omnata_udtf_params,
2419
+ result_columns=obj._omnata_udtf_result_columns,
2420
+ expose_to_consumer=obj._omnata_udtf_expose_to_consumer,
2421
+ handler=obj.__module__+'.'+obj.__name__
2422
+ ))
2423
+ # java doesn't use the python decorator, so we need to check for the class directly
2424
+ for name, obj in inspect.getmembers(module):
2425
+ # Check if the class has the specified attribute
2426
+ if isinstance(obj, UDTFDefinition) and cast(UDTFDefinition,obj).language == 'java':
2427
+ udtf_obj = cast(UDTFDefinition,obj)
2428
+ if udtf_obj.language == 'java':
2429
+ # because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
2430
+ if udtf_obj.expose_to_consumer:
2431
+ if len(udtf_obj.params) == 0 or udtf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
2432
+ udtf_obj.params = [SnowflakeFunctionParameter(
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)
2433
2437
 
2434
2438
  return matching_classes
2435
2439
 
@@ -2512,39 +2516,44 @@ def find_udf_functions(path:str = '.') -> List[UDFDefinition]:
2512
2516
  matching_classes = []
2513
2517
 
2514
2518
  # Iterate over all modules in the current directory
2515
- for _, module_name, _ in pkgutil.iter_modules([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)
2519
+ # Walk through the directory tree
2520
+ for root, _, _ in os.walk(current_dir):
2521
+ # exclude the '.packages' directory
2522
+ if '.packages' in root:
2523
+ continue
2524
+ for _, module_name, _ in pkgutil.iter_modules([root]):
2525
+ # Import the module
2526
+ module = importlib.import_module(module_name)
2527
+
2528
+ # Iterate over all members of the module
2529
+ for name, obj in inspect.getmembers(module, inspect.isfunction):
2530
+ # Check if the class has the specified attribute
2531
+ if hasattr(obj, '_is_omnata_udf'):
2532
+ matching_classes.append(UDFDefinition(
2533
+ name=obj._omnata_udf_name,
2534
+ language='python',
2535
+ runtime_version='3.10',
2536
+ imports=['/app.zip'],
2537
+ description=obj._omnata_udf_description,
2538
+ params=obj._omnata_udf_params,
2539
+ result_data_type=obj._omnata_udf_result_data_type,
2540
+ expose_to_consumer=obj._omnata_udf_expose_to_consumer,
2541
+ packages=[],
2542
+ handler=obj.__module__+'.'+obj.__name__
2543
+ ))
2544
+ # java doesn't use the python decorator, so we need to check for the class directly
2545
+ for name, obj in inspect.getmembers(module):
2546
+ # Check if the class has the specified attribute
2547
+ if isinstance(obj, UDFDefinition):
2548
+ udf_obj = cast(UDFDefinition,obj)
2549
+ if udf_obj.language == 'java':
2550
+ # because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
2551
+ if udf_obj.expose_to_consumer:
2552
+ if len(udf_obj.params) == 0 or udf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
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)
2549
2558
 
2550
2559
  return matching_classes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.6.1a164
3
+ Version: 0.6.2a166
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -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=07j__vFXd_WDfGegTd-E1FfUBVqvMWYQWzY8UCuGdrQ,128600
6
+ omnata_plugin_runtime/omnata_plugin.py,sha256=XI1HdaK_gdrggDTExYuGCk0wnoAqwoWzTxViORnXHCs,129166
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.1a164.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.6.1a164.dist-info/METADATA,sha256=4YRWleBJzW6hBwSIGFu_SjOytzUrHF7Lm4Ce1kNBXg8,1985
11
- omnata_plugin_runtime-0.6.1a164.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
- omnata_plugin_runtime-0.6.1a164.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.6.2a166.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.6.2a166.dist-info/METADATA,sha256=Y-uPLlrrFXkLDodtD-QB6l4Th63mZoGGYOdCAvAxw9I,1985
11
+ omnata_plugin_runtime-0.6.2a166.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
+ omnata_plugin_runtime-0.6.2a166.dist-info/RECORD,,