GH-37598: [Python][Interchange Protocol] Fix the from_dataframe implementation to use the column dtype#37986
Merged
jorisvandenbossche merged 2 commits intoapache:mainfrom Oct 5, 2023
Conversation
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
|
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 334c937. There were 5 benchmark results indicating a performance regression:
The full Conbench report has more details. |
3 tasks
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
… implementation to use the column dtype (apache#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: apache#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>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this pull request
Feb 19, 2024
… implementation to use the column dtype (apache#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: apache#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_dataframepart. The next two steps to solve the connected issue are:from_dataframeimplementationWhat changes are included in this PR?
Fix the
from_dataframeimplementation 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 theDictionaryArray.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.
from_dataframeincorrect #37598