omnata-plugin-runtime 0.5.7a139__py3-none-any.whl → 0.5.7a140__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.
@@ -2232,13 +2232,24 @@ def get_nested_value(nested_dict:Dict, keys:List[str]):
2232
2232
 
2233
2233
  @dataclass
2234
2234
  class SnowflakeFunctionParameter:
2235
+ """
2236
+ Represents a parameter for a Snowflake UDF or UDTF
2237
+ """
2235
2238
  name: str
2236
2239
  description: str
2237
2240
  data_type: str
2238
2241
  default_value_clause: Optional[str] = None
2239
2242
 
2243
+ def __str__(self):
2244
+ if self.default_value_clause:
2245
+ return f"{self.name} {self.data_type} default {self.default_value_clause}"
2246
+ return f"{self.name} {self.data_type}"
2247
+
2240
2248
  @dataclass
2241
2249
  class SnowflakeUDTFResultColumn:
2250
+ """
2251
+ Represents a result column for a Snowflake UDTF
2252
+ """
2242
2253
  name: str
2243
2254
  data_type: str
2244
2255
  description: str
@@ -2248,6 +2259,9 @@ def consumer_udtf(
2248
2259
  description: str,
2249
2260
  params: List[SnowflakeFunctionParameter],
2250
2261
  result_columns: List[SnowflakeUDTFResultColumn]):
2262
+ """
2263
+ A decorator for a class which should be automatically exposed to the consumer as a UDTF
2264
+ """
2251
2265
  def class_decorator(cls):
2252
2266
  # Get the original 'process' method from the class
2253
2267
  original_process = getattr(cls, 'process')
@@ -2304,6 +2318,9 @@ def consumer_udtf(
2304
2318
  return class_decorator
2305
2319
 
2306
2320
  def find_consumer_udtf_classes(path:str = '.'):
2321
+ """
2322
+ Finds all classes in the specified directory which have the 'consumer_udtf' decorator applied
2323
+ """
2307
2324
  # Get the directory's absolute path
2308
2325
  current_dir = os.path.abspath(path)
2309
2326
 
@@ -2328,6 +2345,9 @@ def consumer_udf(
2328
2345
  description: str,
2329
2346
  params: List[SnowflakeFunctionParameter],
2330
2347
  result_data_type: str):
2348
+ """
2349
+ A decorator for a function which should be automatically exposed to the consumer as a UDF
2350
+ """
2331
2351
  def decorator(func):
2332
2352
  sig = signature(func)
2333
2353
  function_params = sig.parameters
@@ -2374,6 +2394,9 @@ def consumer_udf(
2374
2394
  return decorator
2375
2395
 
2376
2396
  def find_consumer_udf_functions(path:str = '.'):
2397
+ """
2398
+ Finds all functions in the specified directory which have the 'consumer_udf' decorator applied
2399
+ """
2377
2400
  # Get the current directory's absolute path
2378
2401
  current_dir = os.path.abspath(path)
2379
2402
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.5.7a139
3
+ Version: 0.5.7a140
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=ummcjxBlTNXo_QdOmvUrAMZ9RoHp3FuBOcLnrMhQBhc,119320
6
+ omnata_plugin_runtime/omnata_plugin.py,sha256=nPCJ6b2cYFS-Gh_UmLUaJvfjgI8v1-DVZWFYWSuj2j8,120102
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.7a139.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
- omnata_plugin_runtime-0.5.7a139.dist-info/METADATA,sha256=elPcTbyT3eCguA6L4olAr359OyvNip3HUiOC0wzfC7Q,1985
11
- omnata_plugin_runtime-0.5.7a139.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
- omnata_plugin_runtime-0.5.7a139.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.5.7a140.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
10
+ omnata_plugin_runtime-0.5.7a140.dist-info/METADATA,sha256=-ohRghA5Z5Z1hblZCVo0qLLniQhM9DmC0N-NJWlwsXM,1985
11
+ omnata_plugin_runtime-0.5.7a140.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
12
+ omnata_plugin_runtime-0.5.7a140.dist-info/RECORD,,