Latest Results
initcolin/flotilla-pre-shuffle-merge feat: Add `get_or_infer_runner_type` to support getting runner type from context (#4810)
## Changes Made
<!-- Describe what changes were made and why. Include implementation
details if necessary. -->
We found that in some scenarios, users need to obtain the Runner type of
Daft in UDF, but currently it can only be obtained through
`daft.context.get_context()._runner.name`. The problem is that the UDF
running on the ray worker gets `None` result when call
`daft.context.get_context()._runner`, so I added a
`daft.context.get_context().get_runner_type()` method in this PR. The
execution mechanism of this method is as follows:
1. Prioritize `daft.context.get_context()._runner` to determine the
Runner type;
2. If `daft.context.get_context()._runner` is `None`, call the
`detect_ray_state` method to determine whether it's currently running on
ray. If so, the current Runner type is considered to be `ray`, otherwise
it is `native`.
In addition, I found that when the `DAFT_RUNNER` env is inconsistent
with `set_runner_xxx`, Daft will prioritize the `set_runner_xxx`
settings, so I added some warn logs to remind users.
## Related Issues
<!-- Link to related GitHub issues, e.g., "Closes #123" -->
No issue
## Checklist
- [ ] Documented in API Docs (if applicable)
- [ ] Documented in User Guide (if applicable)
- [ ] If adding a new documentation page, doc is added to
`docs/mkdocs.yml` navigation
- [ ] Documentation builds and is formatted properly (tag @/ccmao1130
for docs review)
Signed-off-by: plotor <zhenchao.wang@hotmail.com> Active Branches
#45820%
#4874-1%
#4809-1%
© 2025 CodSpeed Technology