Skip to content

Commit d206181

Browse files
increase verbosity
increase verbosity of error message by including the type causing the error in the error message
1 parent 13cdd11 commit d206181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/strings/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def _validate(data):
252252
inferred_dtype = lib.infer_dtype(values, skipna=True)
253253

254254
if inferred_dtype not in allowed_types:
255-
raise AttributeError("Can only use .str accessor with string values!")
255+
raise AttributeError(f"Can only use .str accessor with string values! Inferred dType: {inferred_dtype}")
256256
return inferred_dtype
257257

258258
def __getitem__(self, key):

0 commit comments

Comments
 (0)