Skip to content

pandas.Series.str raises wrong exception #6106

@metakermit

Description

@metakermit

Use the following code snippet to reproduce:

>>> import pandas
>>> pandas.Series.str
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "properties.pyx", line 25, in pandas.lib.cache_readonly.__get__ (pandas/lib.c:29334)
AttributeError: 'NoneType' object has no attribute '_cache'

Expected: a more clear message like:

>>> pandas.Series.bjdksalfjak
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'Series' has no attribute 'bjdksalfjak'

The current behaviour sends the wrong message, as I've discovered with some difficulty trying to debug #5530 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions