Skip to content

Commit

Permalink
Fix DelayedAttr return value
Browse files Browse the repository at this point in the history
Previously we were missing a return statement
  • Loading branch information
mrocklin committed Jan 29, 2019
1 parent 16dc34c commit b365b0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dask/delayed.py
Expand Up @@ -614,7 +614,7 @@ def __getattr__(self, attr):
# code). See https://github.com/dask/dask/pull/4374#issuecomment-454381465
if attr == 'dtype' and self._attr == 'dtype':
raise AttributeError("Attribute %s not found" % attr)
super(DelayedAttr, self).__getattr__(attr)
return super(DelayedAttr, self).__getattr__(attr)

@property
def dask(self):
Expand Down
7 changes: 7 additions & 0 deletions dask/tests/test_delayed.py
Expand Up @@ -600,3 +600,10 @@ def addstatic(x, y):
# For static methods (and regular functions), the decorated methods should
# be Delayed objects.
assert isinstance(A.addstatic, Delayed)


def test_attribute_of_attribute():
x = delayed(123)
assert isinstance(x.a, Delayed)
assert isinstance(x.a.b, Delayed)
assert isinstance(x.a.b.c, Delayed)

0 comments on commit b365b0b

Please sign in to comment.