diff --git a/merlin/io/writer.py b/merlin/io/writer.py index 66c24170d..b4e472a67 100644 --- a/merlin/io/writer.py +++ b/merlin/io/writer.py @@ -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