Skip to content

Commit b74949f

Browse files
committed
Turning on dask-expr for dask-sql to work.
1 parent 7c24161 commit b74949f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

demo/sst.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
Please run the following to set up cloud resources:
55
```
6+
pip install ".[demo]"
67
gcloud auth application-default login
78
coiled login
89
coiled setup gcp --region us-central1
@@ -62,6 +63,7 @@ def rand_wx(times) -> xr.Dataset:
6263
)
6364

6465

66+
# TODO(alxmrs): Make spot instances a flag.
6567
parser = argparse.ArgumentParser()
6668
parser.add_argument('--timeframe', choices=TIMEFRAMES.keys(), default='day')
6769
parser.add_argument(

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ dependencies = [
3232
]
3333

3434
[project.optional-dependencies]
35+
io = [
36+
"xarray[io]",
37+
"gcsfs",
38+
]
3539
test = [
36-
"pytest",
37-
"xarray[io]",
38-
"gcsfs",
40+
"xarray_sql[io]",
41+
"pytest",
3942
]
43+
4044
demo = [
45+
"xarray_sql[io]",
4146
"coiled"
4247
]
4348

xarray_sql/df.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
Block = t.Dict[t.Hashable, slice]
1111
Chunks = t.Optional[t.Dict[str, int]]
1212

13+
# Turn on Dask-Expr
14+
dask.config.set({'dataframe.query-planning-warning': False})
15+
dask.config.set({'dataframe.query-planning': True})
16+
# Turn on Copy-On-Write (needs Pandas 2.0).
17+
pd.options.mode.copy_on_write = True
18+
1319

1420
# Borrowed from Xarray
1521
def _get_chunk_slicer(

0 commit comments

Comments
 (0)