NVIDIA / NVIDIA/cudf

[BUG] Overflow in to_datetime date parsing returns incorrect result

Open
#14,036 0 comments 0 reactions 0 assignees View on GitHub
bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
Overflow in to_datetime date parsing returns incorrect result

**Steps/Code to reproduce bug**
```python
In [2]: from cudf import *

In [5]: to_datetime([99991231], format="%Y%m%d")
Out[5]: DatetimeIndex(['1816-03-29 05:56:08.066277376'], dtype='datetime64[ns]')

In [6]: to_datetime(["99991231"], format="%Y%m%d")
Out[6]: DatetimeIndex(['1816-03-29 05:56:08.066277376'], dtype='datetime64[ns]')

In [7]: to_datetime(["99991231"])
Out[7]: DatetimeIndex(['1816-03-29 05:56:08.066277376'], dtype='datetime64[ns]')
```

**Expected behavior**
If the date cannot be represented, an `Exception` should be raised that the representation overflows

**Environment overview (please complete the following information)**
- Environment location: Bare-metal
- Method of cuDF install: conda
- If method of install is [Docker], provide `docker pull` & `docker run` commands used

**Environment details**
Please run and paste the output of the `cudf/print_env.sh` script here, to gather any other relevant environment details

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.