Skip to content

Commit

Permalink
skip asserts if not using tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray authored Dec 17, 2024
1 parent 61ce79f commit 67534e8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,10 @@ def test_map_partitions_args_and_kwargs_have_collection():
zl = dak.map_partitions(my_power, xl, kwarg_y=yl)

# kwargs that contain collections should be wrapped
assert isinstance(
zl.dask.layers[zl.name].task.func, dak.lib.core.ArgsKwargsPackedFunction
)
if hasattr(zl.dask.layers[zl.name], "task"):
assert isinstance(
zl.dask.layers[zl.name].task.func, dak.lib.core.ArgsKwargsPackedFunction
)

assert_eq(zc, zl)

Expand All @@ -836,7 +837,8 @@ def test_map_partitions_args_and_kwargs_have_collection():
zp = dak.map_partitions(my_power, xl, kwarg_y=2.0)

# this invocation of my_power shouldn't be wrapped, no collections
assert zp.dask.layers[zp.name].task.func is my_power
if hasattr(zp.dask.layers[zp.name], "task"):
assert zp.dask.layers[zp.name].task.func is my_power

assert_eq(zg, zp)

Expand Down

0 comments on commit 67534e8

Please sign in to comment.