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

Method _lower

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

Source from the content-addressed store, hash-verified

198 """
199
200 def _lower(self):
201 # Use `method` to decide how to compose a
202 # shuffle operation from concrete expressions
203
204 # Reduce partition count if necessary
205 frame = self.frame
206 npartitions_out = self.npartitions_out
207 method = self.method or get_default_shuffle_method()
208
209 if npartitions_out < frame.npartitions and method != "p2p":
210 frame = Repartition(frame, new_partitions=npartitions_out)
211
212 ops = [
213 self.partitioning_index,
214 self.npartitions_out,
215 self.ignore_index,
216 self.options,
217 self.original_partitioning_index,
218 ]
219 if method == "p2p":
220 return P2PShuffle(frame, *ops)
221 elif method == "disk":
222 return DiskShuffle(frame, *ops)
223 elif method == "simple":
224 return SimpleShuffle(frame, *ops)
225 elif method == "tasks":
226 return TaskShuffle(frame, *ops)
227 else:
228 raise ValueError(f"{method} not supported")
229
230
231def _is_numeric_cast_type(dtype):

Callers

nothing calls this directly

Calls 6

RepartitionClass · 0.90
P2PShuffleClass · 0.85
DiskShuffleClass · 0.85
SimpleShuffleClass · 0.85
TaskShuffleClass · 0.85

Tested by

no test coverage detected