Skip to content

Commit

Permalink
Add distributed test
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Dec 18, 2023
1 parent cc61fb3 commit ec9b294
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ def test_accessor():

out = ddf.s.ak.count(axis=1).compute()
assert out.tolist() == [1, 2, 1, 2]


def test_distributed():
distributed = pytest.importorskip("distributed")
with distributed.Client(n_workers=1, threads_per_worker=1):
data = [[0], [0, 1]] * 2
s = pd.Series(data, dtype="awkward")
df = pd.DataFrame({"s": s})
ddf = dd.from_pandas(df, 2)
out = ddf.s.ak.count()
assert out.compute().tolist() == [3, 3]
out = ddf.s.ak.count(axis=1).compute()
assert out.tolist() == [1, 2, 1, 2]

0 comments on commit ec9b294

Please sign in to comment.