omnata-plugin-runtime 0.5.7a131__tar.gz → 0.5.7a132__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.7a131
3
+ Version: 0.5.7a132
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.7-a131"
3
+ version = "0.5.7-a132"
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"
@@ -2250,16 +2250,6 @@ def consumer_udtf(param_docs: Dict[str, Dict[str, Any]]):
2250
2250
  if name != 'cls' and name != 'connection_parameters'
2251
2251
  }
2252
2252
 
2253
- DynamicModel = create_model('DynamicModel', **fields)
2254
-
2255
- # Attach the documentation to the function
2256
- original_process.__doc__ = original_process.__doc__ or ""
2257
- original_process.__doc__ += "\n\nArgs:\n"
2258
- for name, param in params.items():
2259
- if name != 'self':
2260
- doc = param_docs.get(name, {})
2261
- original_process.__doc__ += f" {name} ({param.annotation.__name__}): {doc.get('description', 'No description provided.')}\n"
2262
-
2263
2253
  @wraps(original_process)
2264
2254
  def wrapped_process(self, connection_parameters, *args, **kwargs):
2265
2255
  if connection_parameters is None:
@@ -2268,12 +2258,6 @@ def consumer_udtf(param_docs: Dict[str, Dict[str, Any]]):
2268
2258
  if not isinstance(connection_parameters, Dict):
2269
2259
  raise ValueError("The first argument must be an object, the result of calling PLUGIN_CONNECTION.")
2270
2260
 
2271
- try:
2272
- # Validate the arguments using the dynamic Pydantic model
2273
- validated_args = DynamicModel(**kwargs)
2274
- except ValidationError as e:
2275
- raise ValueError(f"Argument validation error: {e}")
2276
-
2277
2261
  # convert the connection parameters dictionary to a ConnectionConfigurationParameters object which includes the real secrets
2278
2262
  if 'other_secrets_name' in connection_parameters:
2279
2263
  # this is the new way, where the sync engine only passes the name of the secret
@@ -2290,7 +2274,7 @@ def consumer_udtf(param_docs: Dict[str, Dict[str, Any]]):
2290
2274
  parameters = ConnectionConfigurationParameters.model_validate(connection_parameters)
2291
2275
 
2292
2276
  # Pass the validated arguments to the function
2293
- return original_process(self, parameters, *args, **validated_args.dict())
2277
+ return original_process(self, parameters, *args, **kwargs)
2294
2278
  # Replace the original 'process' method with the wrapped version
2295
2279
  setattr(cls, 'process', wrapped_process)
2296
2280
 
@@ -2326,22 +2310,6 @@ def consumer_udf(param_docs: Dict[str, Dict[str, Any]]):
2326
2310
  if list(params.keys())[0] != 'connection_parameters':
2327
2311
  raise ValueError("The first argument should be 'connection_parameters'.")
2328
2312
 
2329
- # Create a Pydantic model based on the function signature and the provided documentation
2330
- fields = {
2331
- name: (param.annotation, param_docs.get(name, {}).get("default", param.default))
2332
- for name, param in params.items()
2333
- if name != 'connection_parameters'
2334
- }
2335
-
2336
- DynamicModel = create_model('DynamicModel', **fields)
2337
-
2338
- # Attach the documentation to the function
2339
- func.__doc__ = func.__doc__ or ""
2340
- func.__doc__ += "\n\nArgs:\n"
2341
- for name, param in params.items():
2342
- doc = param_docs.get(name, {})
2343
- func.__doc__ += f" {name} ({param.annotation.__name__}): {doc.get('description', 'No description provided.')}\n"
2344
-
2345
2313
  @wraps(func)
2346
2314
  def wrapper(self, connection_parameters, *args, **kwargs):
2347
2315
  if connection_parameters is None:
@@ -2350,12 +2318,6 @@ def consumer_udf(param_docs: Dict[str, Dict[str, Any]]):
2350
2318
  if not isinstance(connection_parameters, Dict):
2351
2319
  raise ValueError("The first argument must be an object, the result of calling PLUGIN_CONNECTION.")
2352
2320
 
2353
- try:
2354
- # Validate the arguments using the dynamic Pydantic model
2355
- validated_args = DynamicModel(**kwargs)
2356
- except ValidationError as e:
2357
- raise ValueError(f"Argument validation error: {e}")
2358
-
2359
2321
  # convert the connection parameters dictionary to a ConnectionConfigurationParameters object which includes the real secrets
2360
2322
  if 'other_secrets_name' in connection_parameters:
2361
2323
  # this is the new way, where the sync engine only passes the name of the secret
@@ -2372,7 +2334,7 @@ def consumer_udf(param_docs: Dict[str, Dict[str, Any]]):
2372
2334
  parameters = ConnectionConfigurationParameters.model_validate(connection_parameters)
2373
2335
 
2374
2336
  # Pass the validated arguments to the function
2375
- return func(parameters, *args, **validated_args.dict())
2337
+ return func(parameters, *args, **kwargs)
2376
2338
 
2377
2339
  wrapper._is_omnata_consumer_udf = True
2378
2340
  return wrapper