tvalentyn opened a new pull request, #40738:
URL: https://github.com/apache/beam/pull/40738
Annotations returned by PTransform.annotations() require subclassing the
transform, and annotations set with pipeline.transform_annotations() are
attached to every transform applied within its scope, including the
sub-transforms of composites. Some annotations are only meaningful on one
specific step, e.g. the ParDo that runs a particular DoFn.
PTransform.with_annotations() adds annotations to a single transform
instance, similar to PTransform.addAnnotation() in the Java SDK:
- they take precedence over scoped annotations and the ones returned by
annotations(), even if an override of annotations() doesn't call super(),
- like annotations(), and unlike resource hints, the SDK does not copy them
to the sub-transforms of a composite (runners may still apply the annotations
of a composite to its parts),
- ParDo.with_outputs(), ParDo.with_exception_handling() and
CombinePerKey.with_hot_key_fanout() keep them regardless of the order of the
calls; for a ParDo, they stay on the ParDo that runs the DoFn rather than on
the wrapper composites or the threshold-counting transforms.
<!--
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
- [ ] Replace these instructions with a description of your change and why
you have made it.
- [ ] Mention the appropriate issue in your description (for example:
`addresses #123` or `fixes #456`).
- [ ] Update `CHANGES.md` with noteworthy changes.
See [CONTRIBUTING.md]() for more details.
-->
--
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]