-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: resolve issues with test_constructor_dtype_datetime64 #24868
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4376036
np bug no more
simonjayhawkins 5418c75
add np.nan case
simonjayhawkins b31f171
update test_astype_generic_timestamp_no_frequency
simonjayhawkins eda7576
Merge remote-tracking branch 'upstream/master' into series-np-bug
simonjayhawkins 57962f7
troubleshoot - results of ci no longer available
simonjayhawkins 89e8758
astype('int') fails on windows
simonjayhawkins 75db09b
Merge remote-tracking branch 'upstream/master' into series-np-bug
simonjayhawkins 968f048
add astype exception message checks
simonjayhawkins 6425dcd
fix msg in test_astype_to_incorrect_datetimelike
simonjayhawkins 13e364b
Merge remote-tracking branch 'upstream/master' into series-np-bug
simonjayhawkins 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.
Hmm is this not intentional to have around still?
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.
this is explicitly tested by
test_astype_generic_timestamp_no_frequency
. however i've now updated this test so that the error message check is more explicit.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.
@WillAyd
i'm guessing that the intended error message for this test would have been originally that raised by
pandas/pandas/core/dtypes/cast.py
Lines 644 to 646 in af82b2a
and before the conversion to pytest.raises context manager the test was
pandas/pandas/tests/series/test_constructors.py
Lines 680 to 681 in 17a6bc5
which would have been raising
TypeError: missing 1 required positional argument: 'x'
since there was no message check the tested function raising
TypeError
would have incorrectly been considered a test passso this test was never intended to test for
The 'datetime64' dtype has no unit
message.hope that makes it clear!
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.
so I DO want this test to remain, can you simply change it so it is testing with
dtype='datetime64'
, IOW it raises.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.
This might actually be a duplicate test (if so, then can remove)
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.
testing with
dtype='datetime64'
is explicitly tested by another test:test_astype_generic_timestamp_no_frequency
.however within this PR i've also changed
test_astype_generic_timestamp_no_frequency
so that the error message check is more explicit so that it could be removed here.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.
ok, you are going to remove this test? rather, this case?
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.
not removing... since it now passes, additionally constructed the expected result and compared.
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.
so have now added some cases to test_constructor_dtype_datetime64 similar to those in test_constructor_dtype_timedelta64 and also added the exception message check to tests/frame/test_dtypes.py
so could probably remove some of the # GH3414 related stuff