-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: can create IntervalDtype[float32] but not IntervalArray[float32] #45412
Comments
This previously raised before that commit |
I doubt this ever worked since it always went through pd.Index. Starting in 2.0 it should Just Work. We could get it working in 1.5 by dispatching to NumericIndex instead of pd.Index in relevant cases. |
@topper-123 did one of your recent IntervalArray PRs handle this? |
I can take a look at it tonight. |
I did not change The question is if >>> iv_arr = pd.arrays.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
>>> dtype = pd.IntervalDtype(np.float32)
>>> iv_arr.astype(dtype).dtype
interval[float64, right] # 1.5.2
interval[float32, right] # main so something that shouldn't change, has changed. I think the IntervalIndex/IntervalArray constructor tests are insufficient and this should have been caught in the tests. So IMO, we should get those constructor tests up and/or improved. Also, does |
We've gotten rid of most of the places that do this. I'd like to get rid of them all. If an Interval[foo32] array cant be created, the dtype should raise too. |
That would be backwards incompatible (not against it and it's probably ok given taht this is a 2.0 release). |
yah might as well go for it in 2.0 |
@topper-123 IIRC you fixed this already?
|
I’ll look into it tonight. |
this was fixed by #49560 https://www.kaggle.com/code/marcogorelli/pandas-regression-example?scriptVersionId=123565724 OK to remove the 2.0 milestone? removing it for now, don't think it's a blocker, but please do correct me if I'm wrong |
This isn't fixed yet (the 32bit dtype can still be created), but +1 to moving this from 2.0. This isn't urgent in my view. |
It now is possible to create a Interval[float32] array, so this may be OK? |
I may be misunderstanding, but this looks like fine now? @topper-123 could you please clarify what's outstanding? |
I checked and we don't have any tests that instantiate a 32bit dtype. (only relevant if we decide to keep allowing it) |
Best guess is it is because we are going through Index constructor.
The text was updated successfully, but these errors were encountered: