-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: add tests for using .at() with DateTime indexes #48286
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
Conversation
pandas/tests/indexing/test_at.py
Outdated
@@ -97,6 +99,18 @@ def test_at_setitem_categorical_missing(self): | |||
|
|||
tm.assert_frame_equal(df, expected) | |||
|
|||
@pytest.mark.parametrize("row", (to_datetime("2019-01-01"), "2019-01-01")) |
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.
Could you please check the whole DataFrame with tm.assert_frame_equal and use Timestamp() instead too?
pandas/tests/indexing/test_at.py
Outdated
@pytest.mark.parametrize("row", (to_datetime("2019-01-01"), "2019-01-01")) | ||
def test_at_datetime_index(self, row): | ||
df = DataFrame( | ||
data=[[1] * 2] * 2, |
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.
Passing data=1 should work here. The dimensions are defined by columns and index in this case
Hi Patrick, thanks so much for the feedback hopefully this is better. Just aside, I did not ignore your note on creating |
pandas/tests/indexing/test_at.py
Outdated
@@ -97,6 +99,24 @@ def test_at_setitem_categorical_missing(self): | |||
|
|||
tm.assert_frame_equal(df, expected) | |||
|
|||
@pytest.mark.parametrize("row", | |||
(Timestamp("2019-01-01"), | |||
to_datetime("2019-01-01"), |
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 the same as the Timestamp argument
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.
Yes, this can be removed in favor of the Timestamp
param above
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.
Apologies I misunderstood earlier. I thought you were suggesting using Timestamp()
as another test to be added
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.
Yeah, sorry. This wasn't clear on my side
hello! I never left a comment after I fixed what your comments were referring to, just wanted to update you that I took care of it. |
… the class since it was not put in the right place before
Thanks @nealxm |
* add tests outlined in GH29709 * fix styling error caught by github actions * made changes based on suggestions from patrick * fix pep8 mistakes * remove usage of to_datetime() * fix error in pre-commit checks also move my new test to the bottom of the class since it was not put in the right place before Co-authored-by: Neal Muppidi <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.added the tests described in issue #29709 but I feel like more around this subject could be written. let me know what you think! thank you for your time