OutOfBoundsDatetime error when loading feature class to Spatially Enabled DataFrame

455
0
02-29-2020 12:19 PM
NikiforOstanin
New Contributor

Hello!
A have a feature class in geodatabase with date field, containing dates bigger than 01.01.2999.

I wish to transfer my FC into Spatially Enabled DataFrame in Jupyter Notebook, but get "OutOfBoundsDatetime" error.

OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 3000-01-01 00:00:00

 

I also try to change datatype of the field, but this doesn't work, the error still appears.

Here's example of my code:

sdf = pd.DataFrame.spatial.from_table (table,
                         skip_nulls = False,
                         fields = ['id',
                                  'name',
                                  'date'   # the field with dates such as 3000-01-01
                                   ],
                          null_value = nan,
                          dtype = {'date': object}, #doesn`t work
                        # dtype = {'date': str}, #also doesn`t work
                                       )‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Is this a right way to transfer date column into my Spatially Enabled DataFrame (may be ever with oblect or string type) without editing my source feature class? 

0 Kudos
0 Replies