kevingurney opened a new pull request, #37152:
URL: https://github.com/apache/arrow/pull/37152

   ### Rationale for this change
   
   #37098 added utilities for making valid MATLAB `table` `VariableNames` 
(`makeValidVariableNames`) and `DimensionNames` (`makeValidDimensionNames`) 
from an arbitrary list of strings.
   
   This pull request uses these utilities to ensure that `RecordBatch` field 
names are converted to valid MATLAB `table` `VariableNames`/`DimensionNames` 
when calling the `table`/`toMATLAB` methods.
   
   ### What changes are included in this PR?
   
   1. Used `makeValidVariableNames` and `makeValidDimensionNames` utilities in 
the implementation of the `table` method for the `RecordBatch` class to ensure 
that column names are converted to valid MATLAB `table` 
`VariableNames`/`DimensionNames`.
   
   ### Are these changes tested?
   
   Yes.
   
   1. The existing tests in 
`arrow/matlab/test/arrow/tabular/tMakeValidVariableNames.m` and 
`arrow/matlab/test/arrow/tabular/tMakeValidDimensionNames.m` already test that 
an arbitrary list of column names are converted into valid MATLAB `table` 
`VariableNames`/`DimensionNames`.
   2. There is currently no straightforward way to create a `RecordBatch` with 
field names that are invalid MATLAB `VariableNames`/`DimensionNames` using the 
MATLAB interface. When we have a way to do this in the MATLAB interface, we can 
add more "integration" tests which verify that a `RecordBatch` with field names 
that are invalid MATLAB `table` `VariableNames`/`DimensionNames` are converted 
into valid `VariableNames`/`DimensionNames` when the `table`/`toMATLAB` methods 
are called.
   
   ### Are there any user-facing changes?
   
   Yes.
   
   A `RecordBatch` with field names that are invalid MATLAB `table` 
`VariableNames`/`DimensionNames` will now be converted into a MATLAB `table` 
with valid `VariableNames`/`DimensionNames` when calling the `table`/`toMATLAB` 
methods.
   
   ### Future Directions
   
   1. #37046 (this change to the `table` method of the `RecordBatch` class 
should help preserve the behavior of storing original `RecordBatch` field names 
in the `VariableDescriptions` property of the output MATLAB `table` returned by 
`featherread`).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to