-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
concat(..., copy=False) with datetime tz-aware data raises ValueError: cannot create a DatetimeTZBlock without a tz #25257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you post the full traceback? Any interest in working on this? |
I edited to add the full traceback. |
The core issue is here: pandas/pandas/core/internals/managers.py Line 2062 in 3ab9318
Taking a view of a tz aware DatetimeArray removes tz information and is passing the result to a DatetimeTZBlock. 2 options
pandas/pandas/core/internals/blocks.py Lines 229 to 232 in 3ab9318
cc @jreback |
i think .view() for DTA with tz is broken |
Pushing to 0.25.0. I'm hoping to clean up our concat internals before then. But if someone wants to put up a dedicated fix for this before then, that'd be great too. |
I'm unsure whether this was actively resolved or just happens to have been resolved, but I was hitting this bug on one machine with older packages and not hitting the issue (functioning as expected) on another machine with newer packages.
|
Was probably fixed in a recent release. Could use a regression test. |
take |
…it fails on version 0.24.1 but passes on current version
@SurajH1 are you still working on this issue? |
Code Sample, a copy-pastable example if possible
Problem description
Running
pd.concat
with a single dataframe andcopy=False
fails, giving an error aboutcannot create a DatetimeTZBlock without a tz
.Closely related:
Expected Output
The original dataframe, since I'm only
concat
-ing a single dataframe.Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Linux
OS-release: 4.18.0-14-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.1
pytest: 4.2.0
pip: 19.0.1
setuptools: 40.6.3
Cython: 0.29.4
numpy: 1.15.4
scipy: 1.2.0
pyarrow: 0.11.1
xarray: None
IPython: 7.2.0
sphinx: None
patsy: None
dateutil: 2.7.5
pytz: 2018.7
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.2
openpyxl: 2.4.10
xlrd: 1.2.0
xlwt: None
xlsxwriter: 1.1.2
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: 1.2.17
pymysql: None
psycopg2: 2.7.6.1 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: