BUG: AttributeError: 'NoneType' object has no attribute 'total_seconds' using ZoneInfo #48273
Closed
2 of 3 tasks
Labels
Timezones
Timezone data dtype
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
The above error is thrown when creating a
DataFrame
with adatetime
object that uses aZoneInfo
timezone for itstzinfo
. I am in the process of migrating our project frompytz
tozoneinfo
. The code works perfectly if you replace theZoneInfo
timezone with apytz
timezone.Thanks for reading and looking into this!
Expected Behavior
For
pd.DataFrame(data)
to create a dataframe something like:Stack Trace
Installed Versions
INSTALLED VERSIONS
commit : e8093ba
python : 3.9.1.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.128-microsoft-standard
Version : #1 SMP Tue Jun 23 12:58:10 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.4.3
numpy : 1.23.2
pytz : 2022.2.1
dateutil : 2.8.2
setuptools : 58.5.3
pip : 21.3.1
Cython : None
pytest : 7.1.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.9.1
html5lib : None
pymysql : None
psycopg2 : 2.9.3
jinja2 : 3.1.2
IPython : 8.4.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
markupsafe : 2.1.1
matplotlib : 3.5.3
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.9.0
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
xlwt : None
zstandard : None
The text was updated successfully, but these errors were encountered: