-
-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: Add test for pd.read_csv
date parsing not working with dtype_backend="pyarrow"
and missing values
#60286
Merged
mroeschke
merged 7 commits into
pandas-dev:main
from
KevsterAmp:add-dataframe-pyarrow-column-dtype-datetime-test
Nov 15, 2024
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
babed36
add test func
KevsterAmp 574d129
remove io since StringIO is already imported
KevsterAmp 5a9a935
add td.skip_if_no("pyarrow") from CI errors
KevsterAmp b2602cc
Merge remote-tracking branch 'upstream/main' into add-dataframe-pyarr…
KevsterAmp 30b2149
fix test
KevsterAmp 4812f69
improve expect_data; remove assert on "date" column dtype
KevsterAmp 44164ce
Merge remote-tracking branch 'upstream/main' into add-dataframe-pyarr…
KevsterAmp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you build an expected DataFrame and use
tm.assert_frame_equal
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a bit of struggle with the dtype casting, Tried two methods:
Returns error:
For a band-aid fix, I tried casting
string[pyarrow]
as well to the same column in thedf
variable.But for some reason, pytest returns:
Hard to check what's the error exaclty, since the error isn't verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the simplifying the bug report, I don't think we need the string column, only the
"date"
column.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke - Tried this:
Still returns assertion error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally saw the problem lol
tm.assert_frame_equal
should be run withoutassert
. That's why it was showingAssertionError
😆Fixed it now and the test is passing