Polber commented on code in PR #30117:
URL: https://github.com/apache/beam/pull/30117#discussion_r1467987567
##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -139,6 +139,21 @@ def as_provider_list(name, lst):
return [as_provider(name, x) for x in lst]
+def parse_callable_kwargs(spec: Optional[Mapping[str, Any]]):
+ def _parse_callable_kwargs_rec(args, top_level=False):
+ parsed_args = {}
+ for arg, val in args.items():
+ parsed_args[arg] = val
+ if isinstance(val, dict):
Review Comment:
I was just marking kwargs which would only be dicts (I would assume anyway),
but adding support for lists could make it to where a regular arg could be
marked as callable, i.e.
```
- type: PyTransform
config:
constructor: my.pkg.MyTransform
args:
- __callable__: len
- 'a'
kwargs:
key: 'foo'
fn:
__callable__: str.upper
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]