You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
concat: Handle mixed Tensor types for structs (#54386)
<!-- 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. -->
`concat`: Handle mixed Tensor types for structs
**unify_schemas**
- Handle duplicate column names in schema.
- For structs, invoke `unify_schemas` on itself.
- For tensors, handle missing fields.
**concat**
- For structs, `_align_struct_fields` is invoked to handle missing
fields and aligned schemas. Here handle Tensors type mismatch in
`_backfill_missing_fields`.
**Tests**
- Added test fixtures to existing test. No logic changes.
```
test_arrow_concat_empty
test_arrow_concat_single_block
test_arrow_concat_basic
test_arrow_concat_null_promotion
test_arrow_concat_tensor_extension_uniform
test_arrow_concat_tensor_extension_variable_shaped
test_arrow_concat_tensor_extension_uniform_and_variable_shaped
test_arrow_concat_tensor_extension_uniform_but_different
test_arrow_concat_with_objects
test_struct_with_different_field_names
test_nested_structs
test_struct_with_null_values
test_struct_with_mismatched_lengths
test_struct_with_empty_arrays
test_arrow_concat_object_with_tensor_fails
test_unify_schemas
test_unify_schemas_type_promotion
test_arrow_block_select
test_arrow_block_slice_copy
test_arrow_block_slice_copy_empty
```
- Test `concat` of tables with structs & tensors coverage.
```
test_struct_with_arrow_variable_shaped_tensor_type
test_mixed_tensor_types_same_dtype
test_mixed_tensor_types_fixed_shape_different
test_mixed_tensor_types_variable_shaped
test_mixed_tensor_types_in_struct
test_nested_struct_with_mixed_tensor_types
test_multiple_tensor_fields_in_struct
test_struct_with_incompatible_tensor_dtypes_fails
test_struct_with_additional_fields
test_struct_with_null_tensor_values
```
- Test `unify_schema` coverage.
```
test_unify_schemas_null_typed_lists
test_unify_schemas_object_types
test_unify_schemas_duplicate_fields
test_unify_schemas_incompatible_tensor_dtypes
test_unify_schemas_objects_and_tensors
test_unify_schemas_missing_tensor_fields
test_unify_schemas_nested_struct_tensors
test_unify_schemas_edge_cases
test_unify_schemas_mixed_tensor_types
```
## Related issue number
"Closes#54186"
## 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: Srinath Krishnamachari <[email protected]>
0 commit comments