Skip to content

Commit

Permalink
Added test for NaT
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Bertinato committed Feb 9, 2019
1 parent e7a5e15 commit 692e4a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Backwards incompatible API changes
Other API Changes
^^^^^^^^^^^^^^^^^

- ``Timestamp`` and ``Timedelta`` scalars now implement the :meth:`to_numpy` method as aliases to :meth:`Timestamp.to_datetime64` and :meth:`Timedelta.to_timedelta64`, respectively.
- ``Timestamp`` and ``Timedelta`` scalars now implement the :meth:`to_numpy` method as aliases to :meth:`Timestamp.to_datetime64` and :meth:`Timedelta.to_timedelta64`, respectively. (:issue:`24653`)

-
-
Expand Down
5 changes: 5 additions & 0 deletions pandas/tests/scalar/test_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,8 @@ def test_nat_arithmetic_td64_vector(op_name, box):
def test_nat_pinned_docstrings():
# see gh-17327
assert NaT.ctime.__doc__ == datetime.ctime.__doc__


def test_to_numpy_alias():
# GH 24653: alias .to_numpy() for scalars
assert NaT.to_datetime64() == NaT.to_numpy()

0 comments on commit 692e4a0

Please sign in to comment.