-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CI: Test experimental data manager failing due to new JSON format for ExtensionArray dtypes #44994
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
cc @pandas-dev/pandas-core cc @jmg-duarte |
I'll gladly fix it given some guidance, as I have no clue what might have caused it |
@jmg-duarte Here is how to reproduce:
I was able to reproduce on Windows. |
|
This program causes a failure on import os
os.environ["PANDAS_DATA_MANAGER"] = "array"
import decimal
import pandas as pd
from pandas.tests.extension.decimal.array import DecimalArray
dc = DecimalArray([decimal.Decimal(10)])
s = pd.Series(dc, name="d")
s.index.name = "id"
result = s.to_json(orient="table", date_format="iso")
print(result) |
So the fundamental issue here is that for the JSON serialization to work with the array manager, subclasses of def __array__(self, dtype: NpDtype | None = None) -> np.ndarray:
if is_object_dtype(dtype):
return np.array(list(self), dtype=object)
return np.asarray(list(self), dtype=dtype) For any of the built-in So I think we have a number of choices
|
This is likely worth doing regardless. Several of the base class EA methods call
-1 on putting more logic into those files. Block.values_for_json is where the relevant logic lives for BM. Can implement the analogous logic in ArrayManager.column_arrays |
First commit on master causing this:
https://github.com/pandas-dev/pandas/runs/4576767389?check_suite_focus=true
This happened on the pr itself too:
#44722
The text was updated successfully, but these errors were encountered: