Skip to content

Commit

Permalink
Fix package containing RestrictionProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrr committed Aug 1, 2021
1 parent dce846b commit 68ecff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdks/python/apache_beam/examples/snippets/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 68ecff9

Please sign in to comment.