Skip to content

Conversation

@yusufcank34
Copy link
Contributor

@loicdiridollou
Copy link
Member

Hey @yusufcank34 ! Thanks for your contribution, could you add some tests to make sure your behavior is working, feel free to look into https://github.com/pandas-dev/pandas-stubs/blob/main/tests/indexes/test_datetime_index.py for examples on how to write a test (especially the check assert type structure).
Let me know if you have questions!

@yusufcank34
Copy link
Contributor Author

yusufcank34 commented Oct 29, 2025

Hey @yusufcank34 ! Thanks for your contribution, could you add some tests to make sure your behavior is working, feel free to look into https://github.com/pandas-dev/pandas-stubs/blob/main/tests/indexes/test_datetime_index.py for examples on how to write a test (especially the check assert type structure). Let me know if you have questions!

added the new test

Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to run poetry run poe test_all locally before you push as it mirrors the CI pipeline.

@@ -0,0 +1,8 @@
from typing import assert_type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is already a test file for datetime index it is probably cleaner to consolidate your tests there (if we made one test file by issue it would quickly become overwhelming).
Another point is that you’d need to add check(assert_type(…), pd.DatetimeIndex) in top of the assertion you have already added here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yusufcank34 Can you remove that file since it is already covered by the other test you modified? And run pre-commit before you push again, I will merge after it.

Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yusufcank34, nice job on your first PR!

@@ -0,0 +1,8 @@
from typing import assert_type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yusufcank34 Can you remove that file since it is already covered by the other test you modified? And run pre-commit before you push again, I will merge after it.

@loicdiridollou
Copy link
Member

Thanks @yusufcank34 !

@loicdiridollou loicdiridollou merged commit 84f8d36 into pandas-dev:main Oct 30, 2025
16 checks passed
@yusufcank34
Copy link
Contributor Author

Thanks @yusufcank34 !

thk u

@cmp0xff cmp0xff mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Index(DatetimeIndex) erroneously gives Index[Timestamp]

2 participants