BUG: DateOffset addition gives UserWarning: Discarding nonzero nanoseconds in conversion #40948
Open
2 of 3 tasks
Labels
Bug
Frequency
DateOffsets
Numeric Operations
Arithmetic, Comparison, and Logical operations
Warnings
Warnings that appear or should be added to pandas
Code Sample, a copy-pastable example
Output:
Problem description
This program produces correct answers in both cases, but gives a warning about discarding nanoseconds when using DateOffset. I think this is because internally it is converted to a pydatetime somewhere. The warning does not occur with Timedelta, presumably because it's just adding the raw values.
Expected Output
I expect not to get a warning
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 2cb9652
python : 3.9.2.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-33-generic
Version : #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.utf8
LOCALE : en_US.UTF-8
pandas : 1.2.4
numpy : 1.20.2
pytz : 2021.1
dateutil : 2.8.1
pip : 21.0.1
setuptools : 49.6.0.post20210108
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: