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

Class MyExprCachedProperty

dask/tests/test_expr.py:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36
37class MyExprCachedProperty(Expr):
38 called_cached_property = False
39 _parameters = ["foo", "bar"]
40
41 @property
42 def baz(self):
43 return self.foo + self.bar
44
45 @functools.cached_property
46 def cached_property(self):
47 if MyExprCachedProperty.called_cached_property:
48 raise RuntimeError("No!")
49 MyExprCachedProperty.called_cached_property = True
50 return self.foo + self.bar
51
52
53@pytest.mark.slow()

Callers 1

testFunction · 0.85

Calls

no outgoing calls

Tested by 1

testFunction · 0.68