Skip to content

Commit

Permalink
Document that yield and return shouldn't be mixed. (#25060)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvalentyn authored Jan 18, 2023
1 parent aa8dc4f commit 6daa6f4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,8 @@ from the input collection; the Beam SDKs handle that for you. Your `process` met
should accept an argument `element`, which is the input element, and return an
iterable with its output values. You can accomplish this by emitting individual
elements with `yield` statements. You can also use a `return` statement
with an iterable, like a list or a generator.
with an iterable, like a list or a generator. Don't mix `yield` and
`return` statements in the same `process` method - this leads to [undefined behavior](https://github.com/apache/beam/issues/22969).
{{< /paragraph >}}

{{< paragraph class="language-go">}}
Expand Down

0 comments on commit 6daa6f4

Please sign in to comment.