robertwb commented on PR #30117: URL: https://github.com/apache/beam/pull/30117#issuecomment-1912749752
> @robertwb I refactored to use `__callable__` like you suggested in my latest commit. However, this has left me with 2 thoughts. > > 1. It is now inconsistent with `callable` which is used in `MapToFields`, `Filter` and `Explode`. Yes, that's a good point. > * This could be fixed by either changing it back to `callable` or aliasing `__callable__` to the above transforms. However, they do technically have a different function in that the `callable` for the mapping transform has a specific function, meanwhile `__callable__` in terms of `PyTransform`, `Combine`, etc. are more-so telling the transform to evaluate the string as a generic python callable. Yeah. For UDFs, they're inherently not strings, and it's more trying to do a switch statement between (expression, function, named-reference). > 2. PyTransform allows args **AND** kwargs, meanwhile `Combine` and External python providers only allow arg _mappings_ (i.e. kwargs only). > > * I'm wondering if we should fix this inconsistency by either adding support for a list of args in the `Combine` and External python providers? Alternatively, maybe PyTransform should have had only kwargs. (Allowing both gives us this extra level of nesting that's kind of ugly.) Not sure how to fix that now though. I think both of these probably deserve more discussion than just in this PR, with a wider group of people. Either in the weekly meeting or on the dev list. -- 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]
