From b37a3c4e57445fe1ae77d503e6b367ac934dbd19 Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Tue, 9 Jun 2026 14:56:27 -0400 Subject: [PATCH] Fix wordcount_rust requirements.txt and documentation --- sdks/python/apache_beam/examples/wordcount_rust/README.md | 4 ++-- .../apache_beam/examples/wordcount_rust/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/examples/wordcount_rust/README.md b/sdks/python/apache_beam/examples/wordcount_rust/README.md index c02bd9ca8be4..d4c21590802b 100644 --- a/sdks/python/apache_beam/examples/wordcount_rust/README.md +++ b/sdks/python/apache_beam/examples/wordcount_rust/README.md @@ -33,7 +33,7 @@ This will compile the Rust code and build a Python package linked to it in the c To execute wordcount locally using the direct runner, execute the following from the wordcount_rust directory within the same virtual environment: ```bash -python wordcount.py --runner DirectRunner --input * --output counts.txt +python wordcount_rust.py --runner DirectRunner --input * --output counts.txt ``` 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 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: ```bash -python wordcount.py --runner DataflowRunner --input gs://apache-beam-samples/shakespeare/*.txt --output gs:///wordcount_rust/counts.txt --project --region --extra_package ./word_processing/dist/word_processing-0.1.0.tar.gz +python wordcount_rust.py --runner DataflowRunner --input gs://apache-beam-samples/shakespeare/*.txt --output gs:///wordcount_rust/counts.txt --project --region --extra_package ./word_processing/dist/word_processing-0.1.0.tar.gz ``` 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. \ No newline at end of file diff --git a/sdks/python/apache_beam/examples/wordcount_rust/requirements.txt b/sdks/python/apache_beam/examples/wordcount_rust/requirements.txt index 44c79623571d..5969e83d5c0b 100644 --- a/sdks/python/apache_beam/examples/wordcount_rust/requirements.txt +++ b/sdks/python/apache_beam/examples/wordcount_rust/requirements.txt @@ -15,5 +15,5 @@ # limitations under the License. # -build=1.3.0 +build==1.3.0 maturin==1.11.2 \ No newline at end of file