Commits


Joris Van den Bossche authored and GitHub committed 5d58fc68c6d
GH-15053: [C++] Add option to string 'center' kernel to control left/right alignment on odd number of padding (#41449) ### Rationale for this change See the issue https://github.com/apache/arrow/issues/15053 for some more context, but in summary: for the "center" padding, and the number of characters that are being added, one needs to decide whether to add one more character on the left or right. Our implementation (somewhat randomly, I think) decided to put the extra space on the right. The Python standard library however, puts the extra space on the left. And for the usage of pyarrow as a string compute engine in the pandas project, we would like to have the option to have consistent behaviour with Python. ### What changes are included in this PR? Add an option `align_left_on_odd_padding` to `PadOptions` that controls where the extra space is put. This keyword is quite ugly, but I am not sure what other solution there is if we want to give pyarrow users this option (also happy to hear other argument name options) ### Are these changes tested? Yes ### Are there any user-facing changes? No * GitHub Issue: #15053 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>