omnata-plugin-runtime 0.5.7a134__py3-none-any.whl → 0.5.7a136__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -2232,16 +2232,16 @@ def get_nested_value(nested_dict:Dict, keys:List[str]):
2232
2232
 
2233
2233
  @dataclass
2234
2234
  class SnowflakeFunctionParameter:
2235
- arg_name: str
2235
+ name: str
2236
2236
  description: str
2237
- arg_data_type: str
2237
+ data_type: str
2238
2238
  has_default_value: bool = False
2239
2239
  default_value_clause: Optional[str] = None
2240
2240
 
2241
2241
  @dataclass
2242
2242
  class SnowflakeUDTFResultColumn:
2243
- column_name: str
2244
- column_data_type: str
2243
+ name: str
2244
+ data_type: str
2245
2245
  description: str
2246
2246
 
2247
2247
  def consumer_udtf(
@@ -2254,7 +2254,8 @@ def consumer_udtf(
2254
2254
  original_process = getattr(cls, 'process')
2255
2255
  sig = signature(original_process)
2256
2256
  params = sig.parameters
2257
-
2257
+ if len(params) < 2:
2258
+ raise ValueError("The function must have the self parameter, plus at least the mandatory 'connection_parameters' parameter.")
2258
2259
  # Ensure the first argument is mandatory and positional
2259
2260
  if list(params.keys())[0] != 'self':
2260
2261
  raise ValueError("The first argument should be 'self' for class methods.")
@@ -2262,8 +2263,8 @@ def consumer_udtf(
2262
2263
  if list(params.keys())[1] != 'connection_parameters':
2263
2264
  raise ValueError("The second argument should be 'connection_parameters'.")
2264
2265
 
2265
- if params[list(params.keys())[1]].annotation != Dict:
2266
- raise ValueError("The second argument must be a dict.")
2266
+ if params[list(params.keys())[1]].annotation != ConnectionConfigurationParameters:
2267
+ raise ValueError("The second argument must be a ConnectionConfigurationParameters.")
2267
2268
 
2268
2269
  @wraps(original_process)
2269
2270
  def wrapped_process(self, connection_parameters, *args, **kwargs):
@@ -2321,12 +2322,13 @@ def consumer_udf(
2321
2322
  def decorator(func):
2322
2323
  sig = signature(func)
2323
2324
  params = sig.parameters
2324
-
2325
+ if len(params) == 0:
2326
+ raise ValueError("The function must have at least one parameter.")
2325
2327
  # Ensure the first argument is mandatory and positional
2326
2328
  if list(params.keys())[0] != 'connection_parameters':
2327
2329
  raise ValueError("The first argument should be 'connection_parameters'.")
2328
- if params[list(params.keys())[0]].annotation != Dict:
2329
- raise ValueError("The first argument must be a dict.")
2330
+ if params[list(params.keys())[0]].annotation != ConnectionConfigurationParameters:
2331
+ raise ValueError("The first argument must be a ConnectionConfigurationParameters.")
2330
2332
 
2331
2333
  @wraps(func)
2332
2334
  def wrapper(self, connection_parameters, *args, **kwargs):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.5.7a134
3
+ Version: 0.5.7a136
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=WgdUO5PvwwhekdB-hSLr_4hqjK--BXmm6G3opgeDMA8,118075
6
+ omnata_plugin_runtime/omnata_plugin.py,sha256=kW5ZaD763D2yaa9gKyr8e2EoneB3LN01_WPA-lj9cYk,118441
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.7a134.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.5.7a134.dist-info/METADATA,sha256=JGVpgMpr1s7vVOCc9qdKTNKKLxoFnOjx27LtePTLDmM,1985
11
- omnata_plugin_runtime-0.5.7a134.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
- omnata_plugin_runtime-0.5.7a134.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.5.7a136.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.5.7a136.dist-info/METADATA,sha256=e9bGEeVLZ4dOfQsh5NPkpFf2kH3H_JEfAtbYl0wiQE0,1985
11
+ omnata_plugin_runtime-0.5.7a136.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
+ omnata_plugin_runtime-0.5.7a136.dist-info/RECORD,,