Commits


Alenka Frim authored and GitHub committed 334c93726f3
GH-37598: [Python][Interchange Protocol] Fix the from_dataframe implementation to use the column dtype (#37986) ### Rationale for this change We have been defining buffer dtypes for string and timestamp types incorrectly in the DataFrame Interchange Protocol implementation. This PR is the first step to fix the error and is dealing with the `from_dataframe` part. The next two steps to solve the connected issue are: 2. Make sure other libraries have also updated their `from_dataframe` implementation 3. Fix the data buffer dtypes for strings and timestamps. ### What changes are included in this PR? Fix the `from_dataframe` implementation to use the column dtype rather than the data buffer dtype to interpret the buffers. Only for the indices of the categorical column we still use buffer data type in order to convert the indices when constructing the `DictionaryArray`. ### Are these changes tested? No new tests are added but all the existing tests should pass and with that the stability of the change is tested. ### Are there any user-facing changes? No. * Closes: #37598 Lead-authored-by: AlenkaF <frim.alenka@gmail.com> Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com> Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>