-
-
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
BUG: DataFrame.apply not adding a frequency if freq=None (#22150) #22561
Conversation
@HannahFerch : Good start! Will need a |
Codecov Report
@@ Coverage Diff @@
## master #22561 +/- ##
==========================================
- Coverage 92.17% 92.17% -0.01%
==========================================
Files 169 169
Lines 50708 50706 -2
==========================================
- Hits 46740 46738 -2
Misses 3968 3968
Continue to review full report at Codecov.
|
this needs tests. you can simply add the OP hypthoesis test (and the minimal example if needed). pls add a whatsnew note in 0.24 |
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.
comments
Thanks for the feedback. |
@HannahFerch ideally if you could include this test #22150 (comment) in our testing suite, that'd be great. I think |
Hello @HannahFerch! Thanks for updating the PR.
|
@mroeschke Thanks, have tried to do as you suggested |
doc/source/whatsnew/v0.24.0.txt
Outdated
@@ -628,7 +628,7 @@ Datetimelike | |||
- Bug in :meth:`DataFrame.eq` comparison against ``NaT`` incorrectly returning ``True`` or ``NaN`` (:issue:`15697`,:issue:`22163`) | |||
- Bug in :class:`DatetimeIndex` subtraction that incorrectly failed to raise `OverflowError` (:issue:`22492`, :issue:`22508`) | |||
- Bug in :class:`DatetimeIndex` incorrectly allowing indexing with ``Timedelta`` object (:issue:`20464`) | |||
- | |||
- Bug in :class:`DatetimeIndex` where frequency was being set if original frequency was 'None' (:issue:`22150`) |
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.
Nit pick: Could you replace the quotes around None
with double backticks? Like how Timedelta is in the line above.
pandas/tests/frame/test_apply.py
Outdated
df.apply(lambda x: x) | ||
assert index.freq == original.freq | ||
|
||
def test_frequency_is_original_example(self): |
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.
I don't think you need this test anymore since it should be covered by the test above.
# Conflicts: # doc/source/whatsnew/v0.24.0.txt
…andas-dev#22150 # Conflicts: # doc/source/whatsnew/v0.24.0.txt
Fixed syntax in whatsnew
@mroeschke Done. Please let me know if anything else is needed from my side. |
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.
LGTM. @jreback
thanks @HannahFerch |
git diff upstream/master -u -- "*.py" | flake8 --diff