[air] Fix missing comma in DataBatchType Union type#63872
Merged
matthewdeng merged 3 commits intoJun 8, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request fixes a missing comma in the DataBatchType Union definition within python/ray/air/data_batch_type.py, which previously caused 'pyarrow.Table' and 'pandas.DataFrame' to be implicitly concatenated. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
The missing comma between "pyarrow.Table" and "pandas.DataFrame" causes Python to concatenate adjacent string literals into "pyarrow.Tablepandas.DataFrame", which is not a valid type. This makes DataBatchType incomplete — it should include both pyarrow.Table and pandas.DataFrame as separate Union members, matching the equivalent DataBatch type in ray.data.block. Signed-off-by: awen11123 <awen11123@users.noreply.github.com> Signed-off-by: awen <444014092@qq.com>
c4c3b34 to
cf3ee57
Compare
pseudo-rnd-thoughts
approved these changes
Jun 5, 2026
pseudo-rnd-thoughts
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR, LGTM
sampan-s-nayak
pushed a commit
to sampan-s-nayak/ray
that referenced
this pull request
Jun 10, 2026
## Why this change is needed
A missing comma between `"pyarrow.Table"` and `"pandas.DataFrame"` in
the `DataBatchType` Union causes Python to concatenate adjacent string
literals into `"pyarrow.Tablepandas.DataFrame"`, which is not a valid
type.
This makes `DataBatchType` incomplete — it should include both
`pyarrow.Table` and `pandas.DataFrame` as separate Union members,
matching the equivalent `DataBatch` type in `ray.data.block`.
### Before
```python
DataBatchType = Union[
"numpy.ndarray", "pyarrow.Table" "pandas.DataFrame", Dict[str, "numpy.ndarray"]
]
```
↑ "pyarrow.Table" "pandas.DataFrame" concatenated into
"pyarrow.Tablepandas.DataFrame"
### After
```python
DataBatchType = Union[
"numpy.ndarray", "pyarrow.Table", "pandas.DataFrame", Dict[str, "numpy.ndarray"]
]
```
## Related Issues
`DataBatchType` is referenced extensively in
`ray.air.util.data_batch_conversion`, `ray.data.preprocessor`, and
`ray.data.util.data_batch_conversion`. The incorrect type string could
appear in user-facing error messages and type checking.
## Checks
- [x] I have signed the commits with Developer Certificate of Origin
(DCO)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: awen11123 <awen11123@users.noreply.github.com>
Signed-off-by: awen <444014092@qq.com>
Co-authored-by: matthewdeng <matt@anyscale.com>
limarkdcunha
pushed a commit
to limarkdcunha/ray
that referenced
this pull request
Jun 30, 2026
## Why this change is needed
A missing comma between `"pyarrow.Table"` and `"pandas.DataFrame"` in
the `DataBatchType` Union causes Python to concatenate adjacent string
literals into `"pyarrow.Tablepandas.DataFrame"`, which is not a valid
type.
This makes `DataBatchType` incomplete — it should include both
`pyarrow.Table` and `pandas.DataFrame` as separate Union members,
matching the equivalent `DataBatch` type in `ray.data.block`.
### Before
```python
DataBatchType = Union[
"numpy.ndarray", "pyarrow.Table" "pandas.DataFrame", Dict[str, "numpy.ndarray"]
]
```
↑ "pyarrow.Table" "pandas.DataFrame" concatenated into
"pyarrow.Tablepandas.DataFrame"
### After
```python
DataBatchType = Union[
"numpy.ndarray", "pyarrow.Table", "pandas.DataFrame", Dict[str, "numpy.ndarray"]
]
```
## Related Issues
`DataBatchType` is referenced extensively in
`ray.air.util.data_batch_conversion`, `ray.data.preprocessor`, and
`ray.data.util.data_batch_conversion`. The incorrect type string could
appear in user-facing error messages and type checking.
## Checks
- [x] I have signed the commits with Developer Certificate of Origin
(DCO)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: awen11123 <awen11123@users.noreply.github.com>
Signed-off-by: awen <444014092@qq.com>
Co-authored-by: matthewdeng <matt@anyscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change is needed
A missing comma between
"pyarrow.Table"and"pandas.DataFrame"in theDataBatchTypeUnion causes Python to concatenate adjacent string literals into"pyarrow.Tablepandas.DataFrame", which is not a valid type.This makes
DataBatchTypeincomplete — it should include bothpyarrow.Tableandpandas.DataFrameas separate Union members, matching the equivalentDataBatchtype inray.data.block.Before
↑ "pyarrow.Table" "pandas.DataFrame" concatenated into "pyarrow.Tablepandas.DataFrame"
After
Related Issues
DataBatchTypeis referenced extensively inray.air.util.data_batch_conversion,ray.data.preprocessor, andray.data.util.data_batch_conversion. The incorrect type string could appear in user-facing error messages and type checking.Checks
🤖 Generated with Claude Code