Commits


Joris Van den Bossche authored and GitHub committed f9b619b7293
GH-34886: [Python] Add correct __array__ numpy conversion for Table and RecordBatch (#36242) ### Rationale for this change Currently, calling `np.asarray(table)` gives the wrong result (transpose of the expected result), because we don't implement an explicit `__array__` to numpy conversion, and then numpy falls back to iterate the object (but this iterates the columns, giving a transposed result). To fix this unexpected result, I added an actual `__array__` (currently with a naive implementation in python, potentially this could be optimized in our C++ conversion layer) ### Are there any user-facing changes? This changes the behaviour of `np.asarray(table/record_batch)` * Closes: #34886 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>