Description
Code Sample, a copy-pastable example if possible
import pandas as pd
from pandas.testing import assert_series_equal
dt_series = pd.Series((pd.to_datetime('2020-01-01'), pd.to_datetime('2020-01-02')))
actual_result = dt_series.shift(1, fill_value=0)
expected_result = pd.Series((pd.to_datetime('1970-01-01'), pd.to_datetime('2020-01-01')))
assert_series_equal(actual_result, expected_result)
Problem description
Above code snippet works on version 0.25.3 but breaks with 1.0.1.
print(actual_result)
0 0
1 1577836800000000000
dtype: object
print(expected_result)
0 1970-01-01
1 2020-01-01
dtype: datetime64[ns]
AssertionError: Attributes of Series are different
Attribute "dtype" are different
[left]: object
[right]: datetime64[ns]
Output of pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-72-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.1
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 45.2.0.post20200210
Cython : None
pytest : 5.3.2
hypothesis : None
sphinx : 2.3.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.11.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.15.1
pytables : None
pytest : 5.3.2
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.13
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None