From 160d2446924a979b124458464d25b2f74091d93d Mon Sep 17 00:00:00 2001 From: tvalentyn Date: Fri, 13 Oct 2023 09:01:31 -0700 Subject: [PATCH] Update programming-guide.md --- .../www/site/content/en/documentation/programming-guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/www/site/content/en/documentation/programming-guide.md b/website/www/site/content/en/documentation/programming-guide.md index 7c3d9844c25a..564b01a7146e 100644 --- a/website/www/site/content/en/documentation/programming-guide.md +++ b/website/www/site/content/en/documentation/programming-guide.md @@ -1214,10 +1214,10 @@ Here is a sequence diagram that shows the lifecycle of the DoFn during apply to the objects or particular cases such as failover or instance reuse. They also give instantiation use cases. Three key points to note are that: - 1. teardown is done on a best effort basis and thus + 1. Teardown is done on a best effort basis and thus isn't guaranteed. - 2. the number of DoFn instances created at runtime is runner-dependent. - 3. for the Python SDK, the pipeline contents such as DoFn user code, + 2. The number of DoFn instances created at runtime is runner-dependent. + 3. For the Python SDK, the pipeline contents such as DoFn user code, is [serialized into a bytecode](https://beam.apache.org/documentation/sdks/python-pipeline-dependencies/#pickling-and-managing-the-main-session). Therefore, `DoFn`s should not reference objects that are not serializable, such as locks. To manage a single instance of an object across multiple `DoFn` instances in the same process, use utilities in the [shared.py](https://beam.apache.org/releases/pydoc/current/apache_beam.utils.shared.html) module.