omnata-plugin-runtime 0.5.8a159__tar.gz → 0.5.9a161__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.5.8a159
3
+ Version: 0.5.9a161
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.5.8-a159"
3
+ version = "0.5.9-a161"
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"
@@ -2429,7 +2429,16 @@ def find_udtf_classes(path:str = '.') -> List[UDTFDefinition]:
2429
2429
  for name, obj in inspect.getmembers(module):
2430
2430
  # Check if the class has the specified attribute
2431
2431
  if isinstance(obj, UDTFDefinition) and cast(UDTFDefinition,obj).language == 'java':
2432
- matching_classes.append(obj)
2432
+ udtf_obj = cast(UDTFDefinition,obj)
2433
+ if udtf_obj.language == 'java':
2434
+ # because the decorator wasn't used, we need to check if we need to add the connection_parameters parameter
2435
+ if udtf_obj.expose_to_consumer:
2436
+ if len(udtf_obj.params) == 0 or udtf_obj.params[0].name.upper() != 'CONNECTION_PARAMETERS':
2437
+ udtf_obj.params = [SnowflakeFunctionParameter(
2438
+ name='CONNECTION_PARAMETERS',
2439
+ data_type='OBJECT',
2440
+ description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udtf_obj.params
2441
+ matching_classes.append(udtf_obj)
2433
2442
 
2434
2443
  return matching_classes
2435
2444
 
@@ -2535,7 +2544,16 @@ def find_udf_functions(path:str = '.') -> List[UDFDefinition]:
2535
2544
  # java doesn't use the python decorator, so we need to check for the class directly
2536
2545
  for name, obj in inspect.getmembers(module):
2537
2546
  # Check if the class has the specified attribute
2538
- if isinstance(obj, UDFDefinition) and cast(UDFDefinition,obj).language == 'java':
2539
- matching_classes.append(obj)
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)
2540
2558
 
2541
2559
  return matching_classes