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

Class FromGraph

dask/dataframe/dask_expr/io/io.py:39–66  ·  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 prefix = self.operand("name_prefix")
58 return f"{prefix}-{self.deterministic_token}"
59
60 def _layer(self):
61 dsk = dict(self.operand("layer"))
62 # The name may not actually match the layers name therefore rewrite this
63 # using an alias
64 for new, old in zip(self.__dask_keys__(), self.operand("keys")):
65 dsk[new] = Alias(new, old)
66 return dsk
67
68
69class BlockwiseIO(Blockwise, IO):

Callers 1

from_graphFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected