Commit b8bacd5
committed
refactor(ray): unify distributed partitioning on a shared vocabulary
Collapse the three distributed entry points into a single `execute_on_ray(partitions=...)`
and introduce a backend-neutral partition vocabulary in `io_sources/partitions.py`.
A partition is a `ReadPartition(predicate, key)`; `RayPartition` subclasses it to add
per-task `remote_options`. Partitions come from builders:
- `by_time(column, every)` — calendar windows from the pushed-down date range
- `by_value(column, values)` — discrete values (derived from an IN filter when omitted)
- `by_range(column, every)` — fixed-width numeric buckets
- `by_key(partitions, by)` — equality on caller-enumerated keys (was execute_on_ray_by)
- `discrete_partitions` / `cartesian_partitions` — member lists and date x bucket products
`execute_on_ray` accepts a partitioner or an explicit ReadPartition list; the former
requires a bounded pushed-down predicate. The legacy `date_column`/`time_unit` calendar
call is kept as a shortcut. `execute_on_ray_by` and `execute_on_ray_partitions` are removed
(the first becomes `by_key`, the second is just an explicit list).
The vocabulary is intentionally backend-neutral so a SQL reader can consume the same
partitions. Update the ray tests to the unified entry point and add parity tests for the
builders; refresh the README and API-Reference.
Signed-off-by: Pascal Tomecek <40371786+ptomecek@users.noreply.github.com>1 parent decbd28 commit b8bacd5
6 files changed
Lines changed: 619 additions & 310 deletions
File tree
- docs/wiki
- polars_io_tools
- io_sources
- tests/io_sources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
147 | 139 | | |
148 | 140 | | |
149 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
54 | | - | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 60 | | |
65 | 61 | | |
66 | 62 | | |
| |||
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 98 | | |
117 | 99 | | |
118 | 100 | | |
| |||
0 commit comments