Skip to content

Commit

Permalink
Fix rows limit bug on Dask
Browse files Browse the repository at this point in the history
  • Loading branch information
luis11011 committed Oct 4, 2021
1 parent 4709bda commit 81b722a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optimus/engines/base/dask/rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def limit(self, count):
if count is None:
return df

return self.root.new(self.root._base_to_dfd(df.cols.select("*").data.head(count), npartitions=-1))
return self.root.new(
self.root._base_to_dfd(
df.cols.select("*").data.head(count, npartitions=-1), df.partitions() if count > 100 else 1
)
)

def _drop_duplicated_builtin(self, cols):

Expand Down

0 comments on commit 81b722a

Please sign in to comment.