MCPcopy Create free account
hub / github.com/dask/dask / _divisions

Method _divisions

dask/dataframe/dask_expr/_shuffle.py:773–795  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

771 _is_length_preserving = True
772
773 def _divisions(self):
774 if "user_divisions" in self._parameters and self.user_divisions is not None:
775 return self.user_divisions
776 if self._npartitions_input == 1:
777 return (None, None)
778
779 if (
780 is_index_like(self._divisions_column._meta)
781 and self._divisions_column.known_divisions
782 and self._divisions_column.npartitions == self.frame.npartitions
783 ):
784 return self.other.divisions
785
786 divisions, mins, maxes, presorted = _get_divisions(
787 self.frame,
788 self._divisions_column,
789 self._npartitions_input,
790 self.ascending,
791 upsample=self.upsample,
792 )
793 if presorted and len(mins) == self._npartitions_input:
794 divisions = mins.copy() + [maxes[-1]]
795 return divisions
796
797 @property
798 def _npartitions_input(self):

Callers 1

npartitionsMethod · 0.95

Calls 3

is_index_likeFunction · 0.90
_get_divisionsFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected