You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug .str appears to be silently allowing adding new attributes, rather than raising an error.
Steps/Code to reproduce bug
In [1]: importcudfIn [2]: s=cudf.Series(["foo", "bar"])
In [3]: s.str.abc="a"In [5]: s.to_pandas().str.abc="a"---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast)
CellIn[5], line1---->1s.to_pandas().str.abc="a"File/datasets/pgali/envs/cudfdev/lib/python3.12/site-packages/pandas/core/base.py:177, inNoNewAttributesMixin.__setattr__(self, key, value)
166def__setattr__(self, key: str, value) ->None:
167# _cache is used by a decorator168# We need to check both 1.) cls.__dict__ and 2.) getattr(self, key)169# because170# 1.) getattr is false for attributes that raise errors171# 2.) cls.__dict__ doesn't traverse into base classes172ifgetattr(self, "__frozen", False) andnot (
173key=="_cache"174orkeyintype(self).__dict__175orgetattr(self, key, None) isnotNone176 ):
-->177raiseAttributeError(f"You cannot add any new attribute '{key}'")
178object.__setattr__(self, key, value)
AttributeError: Youcannotaddanynewattribute'abc'
The text was updated successfully, but these errors were encountered:
galipremsagar
changed the title
[BUG] .str should dis-allow adding any new attribute other than defined
[BUG] .str should not allow adding any new attribute other than defined
Jan 15, 2025
Describe the bug
.str
appears to be silently allowing adding new attributes, rather than raising an error.Steps/Code to reproduce bug
The text was updated successfully, but these errors were encountered: