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

Class MakeDataframePart

dask/dataframe/io/demo.py:259–298  ·  view source on GitHub ↗

Wrapper Class for ``make_dataframe_part`` Makes a timeseries partition.

Source from the content-addressed store, hash-verified

257
258
259class MakeDataframePart(DataFrameIOFunction):
260 """
261 Wrapper Class for ``make_dataframe_part``
262 Makes a timeseries partition.
263 """
264
265 def __init__(self, index_dtype, dtypes, kwargs, columns=None):
266 self.index_dtype = index_dtype
267 self._columns = columns or list(dtypes.keys())
268 self.dtypes = dtypes
269 self.kwargs = kwargs
270
271 @property
272 def columns(self):
273 return self._columns
274
275 def project_columns(self, columns):
276 """Return a new MakeTimeseriesPart object with
277 a sub-column projection.
278 """
279 if columns == self.columns:
280 return self
281 return MakeDataframePart(
282 self.index_dtype,
283 self.dtypes,
284 self.kwargs,
285 columns=columns,
286 )
287
288 def __call__(self, part):
289 divisions, state_data = part
290 return make_dataframe_part(
291 self.index_dtype,
292 divisions[0],
293 divisions[1],
294 self.dtypes,
295 self.columns,
296 state_data,
297 self.kwargs,
298 )
299
300
301def make_dataframe_part(index_dtype, start, end, dtypes, columns, state_data, kwargs):

Callers 2

project_columnsMethod · 0.85
with_specFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected