Skip to content

Commit e8249af

Browse files
authored
Fix wordcount_rust requirements.txt and documentation (#38877)
* Fix wordcount_rust requirements.txt and documentation * quote wildcard
1 parent 705db25 commit e8249af

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

sdks/python/apache_beam/examples/wordcount_rust/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This will compile the Rust code and build a Python package linked to it in the c
3333
To execute wordcount locally using the direct runner, execute the following from the wordcount_rust directory within the same virtual environment:
3434

3535
```bash
36-
python wordcount.py --runner DirectRunner --input * --output counts.txt
36+
python wordcount_rust.py --runner DirectRunner --input "*" --output counts.txt
3737
```
3838

3939
To execute wordcount using the Dataflow runner, the tarball of the PyO3 Rust package must be provided to GCP. This is done by building the tarball then providing it as an `extra_package` argument. The tarball can be built using the following command from the wordcount_rust directory:
@@ -45,7 +45,7 @@ python -m build --sdist
4545
This places the tarball in `./word_processing/dist` as `word_processing-0.1.0.tar.gz`. Job submission to Dataflow from the `wordcount_rust` directory then looks like the following:
4646

4747
```bash
48-
python wordcount.py --runner DataflowRunner --input gs://apache-beam-samples/shakespeare/*.txt --output gs://<YOUR_BUCKET>/wordcount_rust/counts.txt --project <YOUR_PROJECT> --region <YOUR_REGION> --extra_package ./word_processing/dist/word_processing-0.1.0.tar.gz
48+
python wordcount_rust.py --runner DataflowRunner --input gs://apache-beam-samples/shakespeare/*.txt --output gs://<YOUR_BUCKET>/wordcount_rust/counts.txt --project <YOUR_PROJECT> --region <YOUR_REGION> --extra_package ./word_processing/dist/word_processing-0.1.0.tar.gz
4949
```
5050

5151
The job will then execute on Dataflow, installing the Rust package during worker setup. Wordcount will then execute and produce a counts.txt file in the specified output bucket.

sdks/python/apache_beam/examples/wordcount_rust/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
build=1.3.0
18+
build==1.3.0
1919
maturin==1.11.2

0 commit comments

Comments
 (0)