Skip to content

BUG: Series construction with dtype=JSONDtype() and index but no data RecursionError #33900

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

Open
3 tasks done
simonjayhawkins opened this issue Apr 30, 2020 · 0 comments
Open
3 tasks done
Labels
API - Consistency Internal Consistency of API/Behavior Bug ExtensionArray Extending pandas with custom dtypes or arrays. Nested Data Data where the values are collections (lists, sets, dicts, objects, etc.).

Comments

@simonjayhawkins
Copy link
Member

simonjayhawkins commented Apr 30, 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, a copy-pastable example

>>> import numpy as np
>>> import pandas as pd
>>>
>>> pd.__version__
'1.1.0.dev0+1436.g6016b9841'
>>>
>>> from pandas.tests.extension.json.array import JSONDtype
>>>
>>> pd.Series(index=[1, 2, 3], dtype=JSONDtype())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\simon\pandas\pandas\core\series.py", line 283, in __init__
    data, index = self._init_dict(data, index, dtype)
  File "C:\Users\simon\pandas\pandas\core\series.py", line 372, in _init_dict
    s = create_series_with_explicit_dtype(
  File "C:\Users\simon\pandas\pandas\core\construction.py", line 624, in create_series_with_explicit_dtype
    return Series(
  File "C:\Users\simon\pandas\pandas\core\series.py", line 283, in __init__
    data, index = self._init_dict(data, index, dtype)
  File "C:\Users\simon\pandas\pandas\core\series.py", line 372, in _init_dict
    s = create_series_with_explicit_dtype(
  File "C:\Users\simon\pandas\pandas\core\construction.py", line 624, in create_series_with_explicit_dtype
...
RecursionError: maximum recursion depth exceeded in comparison

Problem description

raises RecursionError

Expected Output

1 {}
2 {}
3 {}
dtype: json

Output of pd.show_versions()

[paste the output of pd.show_versions() here leaving a blank line after the details tag]

@simonjayhawkins simonjayhawkins added Bug Needs Triage Issue that has not been reviewed by a pandas team member ExtensionArray Extending pandas with custom dtypes or arrays. and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 30, 2020
@simonjayhawkins simonjayhawkins added the API - Consistency Internal Consistency of API/Behavior label May 1, 2020
@mroeschke mroeschke added the Nested Data Data where the values are collections (lists, sets, dicts, objects, etc.). label Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Bug ExtensionArray Extending pandas with custom dtypes or arrays. Nested Data Data where the values are collections (lists, sets, dicts, objects, etc.).
Projects
None yet
Development

No branches or pull requests

2 participants