From 68ecff91b87aa14e4730c4c0f40bcb724c1b83d8 Mon Sep 17 00:00:00 2001 From: Jeff Ruane Date: Sun, 1 Aug 2021 17:02:30 -0600 Subject: [PATCH] Fix package containing RestrictionProvider --- sdks/python/apache_beam/examples/snippets/snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/examples/snippets/snippets.py b/sdks/python/apache_beam/examples/snippets/snippets.py index 78814cdf353e0..e4959d31ea6d9 100644 --- a/sdks/python/apache_beam/examples/snippets/snippets.py +++ b/sdks/python/apache_beam/examples/snippets/snippets.py @@ -1647,7 +1647,7 @@ def sdf_basic_example(): read_next_record = None # [START SDF_BasicExample] - class FileToWordsRestrictionProvider(beam.io.RestrictionProvider): + class FileToWordsRestrictionProvider(beam.transforms.core.RestrictionProvider): def initial_restriction(self, file_name): return OffsetRange(0, os.stat(file_name).st_size) @@ -1680,7 +1680,7 @@ def sdf_basic_example_with_splitting(): from apache_beam.io.restriction_trackers import OffsetRange # [START SDF_BasicExampleWithSplitting] - class FileToWordsRestrictionProvider(beam.io.RestrictionProvider): + class FileToWordsRestrictionProvider(beam.transforms.core.RestrictionProvider): def split(self, file_name, restriction): # Compute and output 64 MiB size ranges to process in parallel split_size = 64 * (1 << 20)