diff --git a/sdks/python/apache_beam/options/pipeline_options.py b/sdks/python/apache_beam/options/pipeline_options.py index 5b73b22476b4..3bb849938be3 100644 --- a/sdks/python/apache_beam/options/pipeline_options.py +++ b/sdks/python/apache_beam/options/pipeline_options.py @@ -1994,8 +1994,8 @@ def _add_argparse_args(cls, parser): help=( 'Local path to a file. During job submission, the files will be ' 'staged in the staging area (--staging_location option) and then ' - 'workers will upload them to the worker specific staging location ' - '(e.g. $SEMI_PERSISTENT_DIRECTORY/staged/ for portable runner.')) + 'workers will download them to the worker-specific directory ' + '$SEMI_PERSISTENT_DIRECTORY/staged/.')) parser.add_argument( '--prebuild_sdk_container_engine', help=( diff --git a/website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md b/website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md index 7d27f91d322d..3dd3b3c79aab 100644 --- a/website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md +++ b/website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md @@ -109,10 +109,11 @@ Staged files are downloaded onto the worker: import my_module -* **Data or configuration files**: If you staged non-Python files (such as a JSON config), they are downloaded to the staged files directory. You can locate this directory on the worker by reading the `SEMI_PERSISTENT_DIRECTORY` environment variable, or look for `/tmp/staged` which is the default location for staged files on containerized runners: +* **Data or configuration files**: If you staged non-Python files (such as a JSON config), they are downloaded to the `$SEMI_PERSISTENT_DIRECTORY/staged` directory. The full path depends on the runner, so build it from the environment variable instead of hardcoding it. import os - staged_dir = os.environ.get('SEMI_PERSISTENT_DIRECTORY', '/tmp/staged') + staged_dir = os.path.join( + os.environ.get('SEMI_PERSISTENT_DIRECTORY', '/tmp'), 'staged') config_path = os.path.join(staged_dir, 'data_config.json') ### Importing Plugins on Worker Startup