From a091a7099d6d6a19f34ad1355e7b0052592d4d41 Mon Sep 17 00:00:00 2001 From: scls19fr Date: Thu, 19 Feb 2015 10:57:03 +0100 Subject: [PATCH] Update tslib.pyx Fix https://github.com/pydata/pandas/issues/9513 --- pandas/tslib.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx index 85cb50b8f18ae..d311cf04466f2 100644 --- a/pandas/tslib.pyx +++ b/pandas/tslib.pyx @@ -601,6 +601,9 @@ class NaTType(_NaT): def __reduce__(self): return (__nat_unpickle, (None, )) + def date(self): + raise ValueError("pd.NaT.date() can't return a valid date") + fields = ['year', 'quarter', 'month', 'day', 'hour', 'minute', 'second', 'millisecond', 'microsecond', 'nanosecond', 'week', 'dayofyear']