Repository navigation
[Data] Document V1 fallback in read_orc - #67063
Conversation
Signed-off-by: jiangxt2 <[email protected]>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
| It samples file schemas and may omit columns absent from the sample. | ||
| If you encounter a DataSourceV2 limitation, set | ||
| ``RAY_DATA_USE_DATASOURCE_V2=0`` before importing Ray to use the V1 | ||
| reader. This shared setting also affects ``read_parquet()``. |
There was a problem hiding this comment.
Thanks — verified all three claims against master and they're accurate (the env var is read
into a module constant at import, default is True, and exactly parquet + orc gate on it).
One small ask before merge:
Lead with the programmatic form, which works even after Ray is imported. The env var only takes effect if set before import ray, so a notebook user has no working recipe from this note as written. The codebase's own error messages already use both forms (see the merge_schema error above: DataContext.get_current().use_datasource_v2 = ... "(or set
RAY_DATA_USE_DATASOURCE_V2=...)"). Something like:
If you encounter a DataSourceV2 limitation, use the V1 reader by setting
``ray.data.DataContext.get_current().use_datasource_v2 = False``, or
``RAY_DATA_USE_DATASOURCE_V2=0`` in the environment before importing Ray.
This shared setting also affects ``read_parquet()``.
There was a problem hiding this comment.
Thanks for the suggestion. I updated the read_orc() note to lead with the programmatic DataContext setting, which works after Ray is imported, and retained the environment-variable option for use before importing Ray. I also noted that the shared setting affects read_parquet().
abhishekverma-ray
left a comment
There was a problem hiding this comment.
Added a suggestion, please check.
Signed-off-by: jiangxt2 <[email protected]>
Signed-off-by: jiangxt2 <[email protected]>
## Description Document the V1 fallback in `ray.data.read_orc()` for users who encounter DataSourceV2 limitations. The API note leads with `ray.data.DataContext.get_current().use_datasource_v2 = False`, which can be set after importing Ray and before calling `read_orc()`. It also documents `RAY_DATA_USE_DATASOURCE_V2=0` before importing Ray. The shared setting affects `read_parquet()` as well. This is the non-blocking documentation follow-up requested in [ray-project#66524](ray-project#66524 (comment)). ## Related issues Fixes ray-project#67062. ## Additional information - This PR addresses the documentation task tracked by ray-project#67062; no open PR for this issue was found. - Documentation-only change; runtime behavior is unchanged. - Validation: `pre-commit run --files python/ray/data/read_api.py` and `python3 ci/pipeline/check-test-run.py` passed; Semgrep reported zero findings for `python/ray/data/read_api.py`. - Runtime tests were not run. The pre-push hook mapped `test_delta_sharing.py`, `test_datasource_v2.py`, and `test_orc_datasource_v2.py` as manual because Ray could not be imported without `_raylet.so` in this worktree. - The targeted Sphinx build could not run because `sphinx-build` is unavailable. - AI assistance was used to prepare this change. --------- Signed-off-by: jiangxt2 <[email protected]>
Description
Document the V1 fallback in
ray.data.read_orc()for users who encounter DataSourceV2 limitations. The API note leads withray.data.DataContext.get_current().use_datasource_v2 = False, which can be set after importing Ray and before callingread_orc(). It also documentsRAY_DATA_USE_DATASOURCE_V2=0before importing Ray. The shared setting affectsread_parquet()as well.This is the non-blocking documentation follow-up requested in #66524.
Related issues
Fixes #67062.
Additional information
pre-commit run --files python/ray/data/read_api.pyandpython3 ci/pipeline/check-test-run.pypassed; Semgrep reported zero findings forpython/ray/data/read_api.py.test_delta_sharing.py,test_datasource_v2.py, andtest_orc_datasource_v2.pyas manual because Ray could not be imported without_raylet.soin this worktree.sphinx-buildis unavailable.