Checklist
Describe the bug
When viewing details of objects with columns of type Annotated, the following exception is raised here:
TypeError: issubclass() arg 1 must be a class
One case when this happens is with user objects of FastAPI Users. Here's how this library defines its user class:
id: Mapped[UUID_ID] = mapped_column(GUID, primary_key=True, default=uuid.uuid4)
Where UUID_ID is just uuid.UUID, and GUID is defined here.
My local workaround is to wrap get_column_python_type, and if the returned type is Annotated, return the actual wrapped type:
def _patched_get_column_python_type(column: Column) -> type:
type_ = get_column_python_type(column)
if get_origin(type_) is Annotated:
type_ = get_args(type_)[0]
return type_
Steps to reproduce the bug
No response
Expected behavior
No response
Actual behavior
No response
Debugging material
No response
Environment
- MacOS, Python 3.13, SQLAdmin 0.23.0
Additional context
No response
Checklist
master.Describe the bug
When viewing details of objects with columns of type
Annotated,the following exception is raised here:One case when this happens is with user objects of FastAPI Users. Here's how this library defines its user class:
Where UUID_ID is just uuid.UUID, and GUID is defined here.
My local workaround is to wrap
get_column_python_type, and if the returned type isAnnotated, return the actual wrapped type:Steps to reproduce the bug
No response
Expected behavior
No response
Actual behavior
No response
Debugging material
No response
Environment
Additional context
No response