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

Class FromGraph

dask/dataframe/dask_expr/io/io.py:39–65  ·  view source on GitHub ↗

A DataFrame created from an opaque Dask task graph This is used in persist, for example, and would also be used in any conversion from legacy dataframes.

Source from the content-addressed store, hash-verified

37
38
39class FromGraph(IO):
40 """A DataFrame created from an opaque Dask task graph
41
42 This is used in persist, for example, and would also be used in any
43 conversion from legacy dataframes.
44 """
45
46 _parameters = ["layer", "_meta", "divisions", "keys", "name_prefix"]
47
48 @property
49 def _meta(self):
50 return self.operand("_meta")
51
52 def _divisions(self):
53 return self.operand("divisions")
54
55 @functools.cached_property
56 def _name(self):
57 return self.operand("name_prefix") + "-" + self.deterministic_token
58
59 def _layer(self):
60 dsk = dict(self.operand("layer"))
61 # The name may not actually match the layers name therefore rewrite this
62 # using an alias
63 for new, old in zip(self.__dask_keys__(), self.operand("keys")):
64 dsk[new] = Alias(new, old)
65 return dsk
66
67
68class BlockwiseIO(Blockwise, IO):

Callers 1

from_graphFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected