Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion swat/cas/datamsghandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,16 @@ def typemap(name, typ, dtype=dtype):
elif typ == 'TIME':
return (8, 'NUMERIC', 'TIME')
else:
match = re.match(r'^\W?([A-Za-z])(\d*)', typ.str)
# In Pandas 3.0 the DType for Strings changed
# from Object to StringDType.
# StringDType does not have an .str attribute.
# this api check is the recommended way to
# check for a String column across Pandas versions
if pd.api.types.is_string_dtype(typ):
thetype = "S"
else:
thetype = typ.str
match = re.match(r'^\W?([A-Za-z])(\d*)', thetype)
if match:
out = None
dtype = match.group(1)
Expand Down