-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: deprecate Timedelta.resolution #26839
Conversation
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.
do we have tests for datetime.resolution?
pandas/_libs/tslibs/timedeltas.pyx
Outdated
@@ -950,7 +950,7 @@ cdef class _Timedelta(timedelta): | |||
return np.int64(self.value).view('m8[ns]') | |||
|
|||
@property | |||
def resolution(self): | |||
def reso_str(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.
where did this name come from? maybe min_resolution_string? or just resolution_string is more informative
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.
More or less chosen out of thin air. I think we might use it in some of the internal functions. resolution_string sounds better, will update
can you add a this in the deprecation issue |
Doubtful. Timestamp.resolution and NaT.resolution are both wrong in subtly different ways, planning to do in separate PR. |
will do |
Codecov Report
@@ Coverage Diff @@
## master #26839 +/- ##
==========================================
- Coverage 91.86% 91.85% -0.01%
==========================================
Files 179 179
Lines 50700 50700
==========================================
- Hits 46576 46571 -5
- Misses 4124 4129 +5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26839 +/- ##
==========================================
- Coverage 91.86% 91.86% -0.01%
==========================================
Files 179 180 +1
Lines 50700 50710 +10
==========================================
+ Hits 46576 46583 +7
- Misses 4124 4127 +3
Continue to review full report at Codecov.
|
thanks @jbrockmendel |
We also have a Timestamp.resolution, DatetimeIndex.resolution, TimedeltaIndex.resolution. Should any of those be changed accordingly? |
Yes. Also NaT.resolution. I'll open a new issue. |
git diff upstream/master -u -- "*.py" | flake8 --diff
AFAICT we don't have any tests specifically for Timedelta.resolution, so added one for reso_str.