MCPcopy Index your code
hub / github.com/dask/dask / CustomMetadata

Class CustomMetadata

dask/dataframe/tests/test_utils_dataframe.py:117–136  ·  view source on GitHub ↗

Custom class iterator returning pandas types.

Source from the content-addressed store, hash-verified

115
116 # Iterable
117 class CustomMetadata(Iterable):
118 """Custom class iterator returning pandas types."""
119
120 def __init__(self, max=0):
121 if PANDAS_GE_300:
122 self.types = [("a", "i8"), ("c", "f8"), ("b", "str")]
123 else:
124 self.types = [("a", "i8"), ("c", "f8"), ("b", "O")]
125
126 def __iter__(self):
127 self.n = 0
128 return self
129
130 def __next__(self):
131 if self.n < len(self.types):
132 ret = self.types[self.n]
133 self.n += 1
134 return ret
135 else:
136 raise StopIteration
137
138 meta = make_meta(CustomMetadata())
139 assert (meta.columns == ["a", "c", "b"]).all()

Callers 1

test_make_metaFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_make_metaFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…