Skip to content

Commit

Permalink
Turning on Dask-Expr (#28)
Browse files Browse the repository at this point in the history
This PR enables dask-expr with copy on write semantics in Dask
Dataframes. Fixes #14.
  • Loading branch information
alxmrs authored Mar 3, 2024
1 parent 1de22ff commit 35f910f
Show file tree
Hide file tree
Showing 9 changed files with 3,327 additions and 3 deletions.
415 changes: 415 additions & 0 deletions perf_tests/compute_air.py-2024-03-03T07:42:36+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/compute_air.py-2024-03-03T07:50:18+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/groupby_air.py-2024-03-03T07:43:22+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/groupby_air.py-2024-03-03T07:50:06+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/groupby_air_full.py-2024-03-03T07:44:17+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/groupby_air_full.py-2024-03-03T07:49:53+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/sanity.py-2024-03-03T07:45:47+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
415 changes: 415 additions & 0 deletions perf_tests/sanity.py-2024-03-03T07:49:44+05:30.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions qarray/df.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import itertools
import typing as t

import dask
import dask.dataframe as dd
import numpy as np
import pandas as pd
Expand All @@ -12,6 +13,12 @@
Block = t.Dict[str, slice]
Chunks = t.Dict[str, int]

# Turn on Dask-Expr
dask.config.set({'dataframe.query-planning-warning': False})
dask.config.set({"dataframe.query-planning": True})
# Turn on Copy-On-Write (needs Pandas 2.0).
pd.options.mode.copy_on_write = True


# Borrowed from Xarray
def _get_chunk_slicer(dim: t.Hashable, chunk_index: t.Mapping,
Expand Down Expand Up @@ -123,6 +130,3 @@ def f(b: Block) -> pd.DataFrame:
divisions=divisions,
token=token,
)

# TODO(alxmrs): Try dask expressions dataframe:
# https://github.com/dask-contrib/dask-expr

0 comments on commit 35f910f

Please sign in to comment.