Skip to content

Commit 33d8d70

Browse files
authored
[YAML] - update readme to correct pipeline calls (#36076)
1 parent a2e0909 commit 33d8d70

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

sdks/python/apache_beam/yaml/examples/transforms/jinja/import/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ General setup:
2828
export PIPELINE_FILE=apache_beam/yaml/examples/transforms/jinja/import/wordCountImport.yaml
2929
export KINGLEAR="gs://dataflow-samples/shakespeare/kinglear.txt"
3030
export TEMP_LOCATION="gs://MY-BUCKET/wordCounts/"
31+
export PROJECT="MY-PROJECT"
32+
export REGION="MY-REGION"
3133

3234
cd <PATH_TO_BEAM_REPO>/beam/sdks/python
3335
```
3436

3537
Multiline Run Example:
3638
```sh
3739
python -m apache_beam.yaml.main \
40+
--project=${PROJECT} \
41+
--region=${REGION} \
3842
--yaml_pipeline_file="${PIPELINE_FILE}" \
3943
--jinja_variables='{
4044
"readFromTextTransform": {"path": "'"${KINGLEAR}"'"},
@@ -59,5 +63,7 @@ python -m apache_beam.yaml.main \
5963

6064
Single Line Run Example:
6165
```sh
62-
python -m apache_beam.yaml.main --yaml_pipeline_file="${PIPELINE_FILE}" --jinja_variables='{"readFromTextTransform": {"path": "gs://dataflow-samples/shakespeare/kinglear.txt"}, "mapToFieldsSplitConfig": {"language": "python", "fields":{"value":"1"}}, "explodeTransform":{"fields":"word"}, "combineTransform":{"group_by":"word", "combine":{"value":"sum"}}, "mapToFieldsCountConfig":{"language": "python", "fields":{"output":"word + \" - \" + str(value)"}}, "writeToTextTransform":{"path":"${TEMP_LOCATION}"}}'
66+
python -m apache_beam.yaml.main --project=${PROJECT} --region=${REGION} \
67+
--yaml_pipeline_file="${PIPELINE_FILE}" --jinja_variables='{"readFromTextTransform":
68+
{"path": "'"${KINGLEAR}"'"}, "mapToFieldsSplitConfig": {"language": "python", "fields":{"value":"1"}}, "explodeTransform":{"fields":"word"}, "combineTransform":{"group_by":"word", "combine":{"value":"sum"}}, "mapToFieldsCountConfig":{"language": "python", "fields":{"output":"word + \" - \" + str(value)"}}, "writeToTextTransform":{"path":"'"${TEMP_LOCATION}"'"}}'
6369
```

sdks/python/apache_beam/yaml/examples/transforms/jinja/include/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ General setup:
2727
export PIPELINE_FILE=apache_beam/yaml/examples/transforms/jinja/include/wordCountInclude.yaml
2828
export KINGLEAR="gs://dataflow-samples/shakespeare/kinglear.txt"
2929
export TEMP_LOCATION="gs://MY-BUCKET/wordCounts/"
30+
export PROJECT="MY-PROJECT"
31+
export REGION="MY-REGION"
3032

3133
cd <PATH_TO_BEAM_REPO>/beam/sdks/python
3234
```
3335

3436
Multiline Run Example:
3537
```sh
3638
python -m apache_beam.yaml.main \
39+
--project=${PROJECT} \
40+
--region=${REGION} \
3741
--yaml_pipeline_file="${PIPELINE_FILE}" \
3842
--jinja_variables='{
3943
"readFromTextTransform": {"path": "'"${KINGLEAR}"'"},
@@ -58,6 +62,8 @@ python -m apache_beam.yaml.main \
5862

5963
Single Line Run Example:
6064
```sh
61-
python -m apache_beam.yaml.main --yaml_pipeline_file="${PIPELINE_FILE}" --jinja_variables='{"readFromTextTransform": {"path": "gs://dataflow-samples/shakespeare/kinglear.txt"}, "mapToFieldsSplitConfig": {"language": "python", "fields":{"value":"1"}}, "explodeTransform":{"fields":"word"}, "combineTransform":{"group_by":"word", "combine":{"value":"sum"}}, "mapToFieldsCountConfig":{"language": "python", "fields":{"output":"word + \" - \" + str(value)"}}, "writeToTextTransform":{"path":"${TEMP_LOCATION}"}}'
65+
python -m apache_beam.yaml.main --project=${PROJECT} --region=${REGION} \
66+
--yaml_pipeline_file="${PIPELINE_FILE}" --jinja_variables='{"readFromTextTransform":
67+
{"path": "'"${KINGLEAR}"'"}, "mapToFieldsSplitConfig": {"language": "python", "fields":{"value":"1"}}, "explodeTransform":{"fields":"word"}, "combineTransform":{"group_by":"word", "combine":{"value":"sum"}}, "mapToFieldsCountConfig":{"language": "python", "fields":{"output":"word + \" - \" + str(value)"}}, "writeToTextTransform":{"path":"'"${TEMP_LOCATION}"'"}}'
6268
```
6369

0 commit comments

Comments
 (0)