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
When trying to document a project that's using SQLAlchemy, I get the following error message:
WARNING: error while formatting signature for module.DatabaseModel.created_at: Handler <function process_signature at 0x7f3faac891c0> for event 'autodoc-process-signature' threw an exception (exception: wrapper loop when unwrapping sqlalchemy.orm.mapped_column)
WARNING: error while formatting signature for module.DatabaseModel.updated_at: Handler <function process_signature at 0x7f3faac891c0> for event 'autodoc-process-signature' threw an exception (exception: wrapper loop when unwrapping sqlalchemy.orm.mapped_column)
Extension error (sphinx_autodoc_typehints):
Handler <function process_signature at 0x7fdf8b48d1c0> for event 'autodoc-process-signature' threw an exception (exception: wrapper loop when unwrapping sqlalchemy.orm.mapped_column)
I fear SQLalchemy is generally troublesome when it comes to autodoc, which is why it's added to autodoc_mock_imports in my conf.py. Would it be possible to do something similar with sphinx-autodoc-typehints?
A reproducible example:
fromdatetimeimportdatetimefromsqlalchemy.ormimportDeclarativeBase, Mapped, mapped_columnfromsqlalchemy.sqlimportfuncclassDatabaseModel(DeclarativeBase): # pylint: disable=too-few-public-methods"""The declarative base for the ORM. Adds ``created_at`` and ``updated_at`` timestamp columns."""created_at: Mapped[datetime] =mapped_column(server_default=func.now())
"""A ``datetime`` object, that is set on creation."""updated_at: Mapped[datetime] =mapped_column(server_default=func.now(), server_onupdate=func.now())
"""A ``datetime`` object, that is updated on changes."""
The text was updated successfully, but these errors were encountered:
FynnFreyer
changed the title
autodoc-typehints fails on SQLAlchemy types
autodoc-typehints fails on SQLAlchemy models
Dec 3, 2023
When trying to document a project that's using SQLAlchemy, I get the following error message:
I fear SQLalchemy is generally troublesome when it comes to autodoc, which is why it's added to
autodoc_mock_imports
in myconf.py
. Would it be possible to do something similar with sphinx-autodoc-typehints?A reproducible example:
The text was updated successfully, but these errors were encountered: