Skip to content
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

BUG: Cannot create third-party ExtensionArrays for datetime types #34986

Closed
2 of 3 tasks
xhochy opened this issue Jun 25, 2020 · 3 comments · Fixed by #34987 or #48640
Closed
2 of 3 tasks

BUG: Cannot create third-party ExtensionArrays for datetime types #34986

xhochy opened this issue Jun 25, 2020 · 3 comments · Fixed by #34987 or #48640
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays. Regression Functionality that used to work in a prior pandas version Timestamp pd.Timestamp and associated methods Timezones Timezone data dtype
Milestone

Comments

@xhochy
Copy link
Contributor

xhochy commented Jun 25, 2020

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Code Sample: #34987

Problem description

With #33400 type checks now fasttrack on the kind of the dtype. Thus for every ExtensionDtype that is of kind M, is_datetime64tz_dtype returns True. This is then used in get_block_type which leads to the usage of DatetimeTZBlock for all of these arrays although this block only supports DatetimeArray.

elif is_datetime64tz_dtype(values.dtype):
cls = DatetimeTZBlock
elif is_interval_dtype(dtype) or is_period_dtype(dtype):
cls = ObjectValuesExtensionBlock
elif is_extension_array_dtype(values.dtype):
cls = ExtensionBlock

@xhochy xhochy added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 25, 2020
@jbrockmendel jbrockmendel added the ExtensionArray Extending pandas with custom dtypes or arrays. label Sep 3, 2020
@TomAugspurger TomAugspurger removed the Needs Triage Issue that has not been reviewed by a pandas team member label Sep 4, 2020
@simonjayhawkins simonjayhawkins added the Regression Functionality that used to work in a prior pandas version label Dec 6, 2020
@jreback jreback added this to the 1.3 milestone Jan 14, 2021
@mroeschke
Copy link
Member

I ran into this in #47515

Since #34987, just added some unit tests, I think this behavior should still be fixed so reopening.

@mroeschke mroeschke reopened this Jun 27, 2022
@mroeschke mroeschke added Timezones Timezone data dtype Timestamp pd.Timestamp and associated methods labels Jun 27, 2022
@jbrockmendel
Copy link
Member

@mroeschke will this be fixed by your is_datetime64tz_dtype PR?

@mroeschke
Copy link
Member

I did refactor my original is_datetime64tz_dtype PR #48258 to only be a unit test since I think another one of your PRs fixed the original issue, but can open a separate PR to reintroduce the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays. Regression Functionality that used to work in a prior pandas version Timestamp pd.Timestamp and associated methods Timezones Timezone data dtype
Projects
None yet
7 participants