Commit 2059a90
authored
<!-- Thank you for your contribution! Please review
https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before
opening a pull request. -->
<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->
## Why are these changes needed?
<!-- Please give a short summary of the change and the problem this
solves. -->
If you call `read_parquet` with `partitioning=None` and non-empty
`columns`, then Ray Data raises a error because of a missing branch.
This PR fixes that issue.
```
Traceback (most recent call last):
File "/root/lab42_vr/test.py", line 6, in <module>
ds = ray.data.read_parquet(input_s3_path, partitioning=None, columns=columns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.venv/lib/python3.12/site-packages/ray/data/read_api.py", line 950, in read_parquet
datasource = ParquetDatasource(
^^^^^^^^^^^^^^^^^^
File "/root/.venv/lib/python3.12/site-packages/ray/data/_internal/datasource/parquet_datasource.py", line 262, in __init__
data_columns, partition_columns = _infer_data_and_partition_columns(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.venv/lib/python3.12/site-packages/ray/data/_internal/datasource/parquet_datasource.py", line 817, in _infer_data_and_partition_columns
return data_columns, partition_columns
^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'partition_columns' where it is not associated with a value
```
## Related issue number
<!-- For example: "Closes #1234" -->
Fixes #55279
## Checks
- [ ] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
- [ ] Unit tests
- [ ] Release tests
- [ ] This PR is not tested :(
---------
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
1 parent 6d27fc2 commit 2059a90
File tree
2 files changed
+14
-0
lines changed- python/ray/data
- _internal/datasource
- tests
2 files changed
+14
-0
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
828 | 831 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2223 | 2223 | | |
2224 | 2224 | | |
2225 | 2225 | | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
2226 | 2237 | | |
2227 | 2238 | | |
2228 | 2239 | | |
| |||
0 commit comments