Skip to content

Commit

Permalink
avoid divide-by-zero error (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora authored Apr 23, 2024
1 parent 6e52b48 commit e89fcaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion merlin/io/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _add_data_slice(self, df):
# the df and write out slices.
if self.shuffle:
df = shuffle_df(df)
int_slice_size = df.shape[0] // self.num_out_files
int_slice_size = max(df.shape[0] // self.num_out_files, 1)
slice_size = int_slice_size if df.shape[0] % int_slice_size == 0 else int_slice_size + 1
for x in range(self.num_out_files):
start = x * slice_size
Expand Down

0 comments on commit e89fcaa

Please sign in to comment.