Skip to content

Commit d26a68b

Browse files
authored
fix: ensure has_dict_attribute checks for __dict__ attribute (#579)
Ensure `has_dict_attribute` checks for `__dict__` attribute
1 parent 6fdead7 commit d26a68b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

advanced_alchemy/service/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def has_dict_attribute(obj: Any) -> "TypeGuard[DictProtocol]":
261261
bool
262262
"""
263263
# Protocol checking returns True for None, so add explicit check
264-
return obj is not None and isinstance(obj, DictProtocol)
264+
return obj is not None and hasattr(obj, "__dict__")
265265

266266

267267
def is_row_mapping(v: Any) -> TypeGuard["RowMapping"]:

0 commit comments

Comments
 (0)