File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -425,3 +425,4 @@ Categorical
425425Other
426426^^^^^
427427- 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 -*-
12# cython: profile=False
23
34import warnings
@@ -3922,7 +3923,7 @@ for _method_name in _nat_methods:
39223923 def f (*args , **kwargs ):
39233924 return NaT
39243925 f.__name__ = func_name
3925- f.__doc__ = _get_docstring(_method_name )
3926+ f.__doc__ = _get_docstring(func_name )
39263927 return f
39273928
39283929 setattr (NaTType, _method_name, _make_nat_func(_method_name))
@@ -3934,7 +3935,7 @@ for _method_name in _nan_methods:
39343935 def f (*args , **kwargs ):
39353936 return np.nan
39363937 f.__name__ = func_name
3937- f.__doc__ = _get_docstring(_method_name )
3938+ f.__doc__ = _get_docstring(func_name )
39383939 return f
39393940
39403941 setattr (NaTType, _method_name, _make_nan_func(_method_name))
@@ -3952,7 +3953,7 @@ for _maybe_method_name in dir(NaTType):
39523953 def f (*args , **kwargs ):
39533954 raise ValueError (" NaTType does not support " + func_name)
39543955 f.__name__ = func_name
3955- f.__doc__ = _get_docstring(_method_name )
3956+ f.__doc__ = _get_docstring(func_name )
39563957 return f
39573958
39583959 setattr (NaTType, _maybe_method_name,
Original file line number Diff line number Diff line change @@ -247,3 +247,8 @@ def test_nat_arithmetic_index():
247247 tm .assert_index_equal (right + left , exp )
248248 tm .assert_index_equal (left - right , exp )
249249 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