Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove recursion in task spec #1158

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dask_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
cache-environment-key: environment-${{ steps.date.outputs.date }}-0

- name: Install current main versions of dask
run: python -m pip install git+https://github.com/dask/dask
run: python -m pip install git+https://github.com/fjetter/dask@task_spec_remove_recursion

- name: Install current main versions of distributed
run: python -m pip install git+https://github.com/dask/distributed
run: python -m pip install git+https://github.com/fjetter/distributed@task_spec_remove_recursion

- name: Install dask-expr
run: python -m pip install -e . --no-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
cache-environment-key: environment-${{ steps.date.outputs.date }}-1

- name: Install current main versions of dask
run: python -m pip install git+https://github.com/dask/dask
run: python -m pip install git+https://github.com/fjetter/dask@task_spec_remove_recursion
if: ${{ matrix.environment-file == 'ci/environment.yml' }}

- name: Install current main versions of distributed
run: python -m pip install git+https://github.com/dask/distributed
run: python -m pip install git+https://github.com/fjetter/distributed@task_spec_remove_recursion
if: ${{ matrix.environment-file == 'ci/environment.yml' }}

- name: Install dask-expr
Expand Down
4 changes: 2 additions & 2 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ dependencies:
- sqlalchemy
- xarray
- pip:
- git+https://github.com/dask/distributed
- git+https://github.com/dask/dask
- git+https://github.com/fjetter/distributed@task_spec_remove_recursion
- git+https://github.com/fjetter/dask@task_spec_remove_recursion
4 changes: 2 additions & 2 deletions dask_expr/_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def _layer(self) -> dict:
_barrier_key_left,
p2p_barrier,
token_left,
transfer_keys_left,
*transfer_keys_left,
spec=DataFrameShuffleSpec(
id=token_left,
npartitions=self.npartitions,
Expand All @@ -698,7 +698,7 @@ def _layer(self) -> dict:
_barrier_key_right,
p2p_barrier,
token_right,
transfer_keys_right,
*transfer_keys_right,
spec=DataFrameShuffleSpec(
id=token_right,
npartitions=self.npartitions,
Expand Down
2 changes: 1 addition & 1 deletion dask_expr/_shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def _layer(self):
_barrier_key,
p2p_barrier,
token,
transfer_keys,
*transfer_keys,
spec=DataFrameShuffleSpec(
id=shuffle_id,
npartitions=self.npartitions_out,
Expand Down
4 changes: 2 additions & 2 deletions dask_expr/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import numpy as np
import pyarrow as pa
from dask._task_spec import Task
from dask._task_spec import List, Task
from dask.dataframe import methods
from dask.dataframe._pyarrow import to_pyarrow_string
from dask.dataframe.core import apply_and_enforce, is_dataframe_like, make_meta
Expand Down Expand Up @@ -135,7 +135,7 @@ def _task(self, name: Key, index: int) -> Task:
bucket = self._fusion_buckets[index]
# FIXME: This will likely require a wrapper
return Task(
name, methods.concat, [expr._filtered_task(name, i) for i in bucket]
name, methods.concat, List(*(expr._filtered_task(name, i) for i in bucket))
)

@functools.cached_property
Expand Down
2 changes: 1 addition & 1 deletion dask_expr/io/tests/test_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ def test_pickle_size(tmpdir, filesystem):
df = read_parquet(tmpdir, filesystem=filesystem)
from distributed.protocol import dumps

assert len(b"".join(dumps(df.optimize().dask))) <= 9000
assert len(b"".join(dumps(df.optimize().dask))) <= 9100
Loading