Skip to content

Commit

Permalink
Merge branch 'main' into cache-query-planning-config
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora authored Jun 18, 2024
2 parents 0a8a6e1 + 1755a71 commit e8c98cb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions dask/delayed.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,17 @@ def unpack_collections(expr):
if hasattr(expr, f.name)
}
replace(expr, **_fields)
except TypeError as e:
raise TypeError(
f"Failed to unpack {typ} instance. "
"Note that using a custom __init__ is not supported."
) from e
except ValueError as e:
raise ValueError(
f"Failed to unpack {typ} instance. "
"Note that using fields with `init=False` are not supported."
) from e
except (TypeError, ValueError) as e:
if isinstance(e, ValueError) or "is declared with init=False" in str(e):
raise ValueError(
f"Failed to unpack {typ} instance. "
"Note that using fields with `init=False` are not supported."
) from e
else:
raise TypeError(
f"Failed to unpack {typ} instance. "
"Note that using a custom __init__ is not supported."
) from e
return (apply, typ, (), (dict, args)), collections

if is_namedtuple_instance(expr):
Expand Down
2 changes: 1 addition & 1 deletion dask/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def f(a, c):
assert "not supported" in b_arg.lower()
assert "dask" in b_arg.lower()

assert " extra docstring\n\n" in Zap.f.__doc__
assert "extra docstring\n\n" in Zap.f.__doc__


@pytest.mark.parametrize(
Expand Down

0 comments on commit e8c98cb

Please sign in to comment.