MCPcopy
hub / github.com/dask/dask / _BackendData

Class _BackendData

dask/dataframe/dask_expr/_util.py:111–142  ·  view source on GitHub ↗

Helper class to wrap backend data The primary purpose of this class is to provide caching outside the ``FromPandas`` class.

Source from the content-addressed store, hash-verified

109
110
111class _BackendData:
112 """Helper class to wrap backend data
113
114 The primary purpose of this class is to provide
115 caching outside the ``FromPandas`` class.
116 """
117
118 def __init__(self, data):
119 self._data = data
120 self._division_info = LRU(10)
121
122 @functools.cached_property
123 def _token(self):
124 from dask.tokenize import _tokenize_deterministic
125
126 return _tokenize_deterministic(self._data)
127
128 def __len__(self):
129 return len(self._data)
130
131 def __getattr__(self, key: str) -> Any:
132 try:
133 return object.__getattribute__(self, key)
134 except AttributeError:
135 # Return the underlying backend attribute
136 return getattr(self._data, key)
137
138 def __reduce__(self):
139 return type(self), (self._data,)
140
141 def __deepcopy__(self, memodict=None):
142 return type(self)(self._data.copy())
143
144
145@normalize_token.register(_BackendData)

Callers 4

_lowerMethod · 0.90
from_pandasFunction · 0.90
repartitionFunction · 0.90
frameMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…