File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -425,3 +425,4 @@ Categorical
425
425
Other
426
426
^^^^^
427
427
- Bug in :func:`eval` where the ``inplace`` parameter was being incorrectly handled (:issue:`16732`)
428
+ - Several ``NaT`` method docstrings (e.g. :func:`NaT.ctime`) were incorrect (:issue:`17327`)
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
1
2
# cython: profile=False
2
3
3
4
import warnings
@@ -3922,7 +3923,7 @@ for _method_name in _nat_methods:
3922
3923
def f (*args , **kwargs ):
3923
3924
return NaT
3924
3925
f.__name__ = func_name
3925
- f.__doc__ = _get_docstring(_method_name )
3926
+ f.__doc__ = _get_docstring(func_name )
3926
3927
return f
3927
3928
3928
3929
setattr (NaTType, _method_name, _make_nat_func(_method_name))
@@ -3934,7 +3935,7 @@ for _method_name in _nan_methods:
3934
3935
def f (*args , **kwargs ):
3935
3936
return np.nan
3936
3937
f.__name__ = func_name
3937
- f.__doc__ = _get_docstring(_method_name )
3938
+ f.__doc__ = _get_docstring(func_name )
3938
3939
return f
3939
3940
3940
3941
setattr (NaTType, _method_name, _make_nan_func(_method_name))
@@ -3952,7 +3953,7 @@ for _maybe_method_name in dir(NaTType):
3952
3953
def f (*args , **kwargs ):
3953
3954
raise ValueError (" NaTType does not support " + func_name)
3954
3955
f.__name__ = func_name
3955
- f.__doc__ = _get_docstring(_method_name )
3956
+ f.__doc__ = _get_docstring(func_name )
3956
3957
return f
3957
3958
3958
3959
setattr (NaTType, _maybe_method_name,
Original file line number Diff line number Diff line change @@ -247,3 +247,8 @@ def test_nat_arithmetic_index():
247
247
tm .assert_index_equal (right + left , exp )
248
248
tm .assert_index_equal (left - right , exp )
249
249
tm .assert_index_equal (right - left , exp )
250
+
251
+
252
+ def test_nat_pinned_docstrings ():
253
+ # GH17327
254
+ assert NaT .ctime .__doc__ == datetime .ctime .__doc__
You can’t perform that action at this time.
0 commit comments