robertwb commented on code in PR #28289:
URL: https://github.com/apache/beam/pull/28289#discussion_r1329144050
##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -61,6 +61,16 @@ def provided_transforms(self) -> Iterable[str]:
"""Returns a list of transform type names this provider can handle."""
raise NotImplementedError(type(self))
+ def requires_inputs(self, typ: str, args: Mapping[str, Any]) -> bool:
+ """Returns whether this transform requires inputs.
+
+ Specifically, if this returns True and inputs are not provided than an
error
+ will be thrown.
+
+ This is best-effort, primarily for better and earlier error messages.
+ """
+ return not typ.startswith('Read')
Review Comment:
Yep, just a reasonable default. Most transforms that do not start with Read
require an input by, the main exception being SQL (where we can't tell and the
"typical" use of selecting on PCollection would be good to error on). One can
explicitly state `inputs: []` to suppress this error.
--
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]