Skip to content

Commit

Permalink
Early return for num_shards==0 in the Beam pipeline. (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcenacp authored Dec 3, 2024
1 parent f533cee commit 5fbea37
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def execute_operations_in_beam(
enumerate(files)
)
num_shards = len(files)
if not num_shards:
raise ValueError(
f"Empty {record_set=}. No files found for filters={json.dumps(filters)}"
)

# We don't know in advance the number of records per shards. So we just allocate the
# maximum number which is `sys.maxsize // num_shards`. Taking the practical case of
Expand Down

0 comments on commit 5fbea37

Please sign in to comment.