-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG/ENH: Handle AmbiguousTimeError in date rounding #22647
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
Hello @mroeschke! Thanks for updating the PR.
Comment last updated on September 19, 2018 at 20:20 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #22647 +/- ##
==========================================
+ Coverage 92.17% 92.17% +<.01%
==========================================
Files 169 169
Lines 50769 50772 +3
==========================================
+ Hits 46798 46801 +3
Misses 3971 3971
Continue to review full report at Codecov.
|
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.
looks fine
ambiguous : bool, 'NaT', default 'raise' | ||
- bool contains flags to determine if time is dst or not (note | ||
that this flag is only applicable for ambiguous fall dst dates) | ||
- 'NaT' will return NaT for an ambiguous time |
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 add versionadded tags here (and other new arg places)
that this flag is only applicable for ambiguous fall dst dates) | ||
- 'NaT' will return NaT for an ambiguous time | ||
- 'raise' will raise an AmbiguousTimeError for an ambiguous time | ||
|
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.
may make sense to provide a template for the doc-strings (can be followup)
- 'infer' will attempt to infer fall dst-transition hours based on | ||
order | ||
- bool-ndarray where True signifies a DST time, False designates | ||
a non-DST time (note that this flag is only applicable for |
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.
versionadded
can you test for .dt accessors as well?
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.
The .dt accessor tests are here:
def test_dt_round(self, method, dates): |
Addressed your comments and all green @jreback |
thanks @mroeschke |
git diff upstream/master -u -- "*.py" | flake8 --diff
Discussed in #22560, adding an
ambiguous
argument toround
,ceil
andfloor
so the user can dictate how to handle rounding timestamps that land on ambiguous times.