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
While playing around with the gino ORM on the shell, I kept encountering the NoInspectionAvailable error.
Eventually, I traced this back to @generic_repr decorator and removing it fixed the problem.
Here is the full stack trace:
In [1]: fromapp.settings.globalsimportARQ_BACKGROUND_FUNCTIONS, DATABASE_CONFIG
...: fromapp.models.orm.userimportUser
...: fromapp.applicationimportapp, db
...: awaitdb.set_bind(DATABASE_CONFIG.url)
...: awaitUser.get(1)
Out[1]: -------------------------------------------------NoInspectionAvailableTraceback (mostrecentcalllast)
/my_env/lib/python3.8/site-packages/IPython/core/formatters.py(702)__call__()
700type_pprinters=self.type_printers,
701deferred_pprinters=self.deferred_printers)
-->702printer.pretty(obj)
703printer.flush()
704returnstream.getvalue()
/my_env/lib/python3.8/site-packages/IPython/lib/pretty.py(394)pretty()
392ifclsisnotobject \
393andcallable(cls.__dict__.get('__repr__')):
-->394return_repr_pprint(obj, self, cycle)
395396return_default_pprint(obj, self, cycle)
/my_env/lib/python3.8/site-packages/IPython/lib/pretty.py(700)_repr_pprint()
698"""A pprint that just redirects to the normal repr function."""699# Find newlines and replace them with p.break_()-->700output=repr(obj)
701lines=output.splitlines()
702withp.group():
/my_env/lib/python3.8/site-packages/sqlalchemy_utils/models.py(89)<lambda>()
87iflen(fields) ==1andcallable(fields[0]):
88target=fields[0]
--->89target.__repr__=lambdaself: _generic_repr_method(self, fields=None)
90returntarget91else:
/my_env/lib/python3.8/site-packages/sqlalchemy_utils/models.py(42)_generic_repr_method()
4041def_generic_repr_method(self, fields):
--->42state=sa.inspect(self)
43field_reprs= []
44ifnotfields:
>/my_env/lib/python3.8/site-packages/sqlalchemy/inspection.py(71)inspect()
6970ifraiseerrand (regisNoneorretisNone):
--->71raiseexc.NoInspectionAvailable(
72"No inspection system is "73"available for object of type %s"%type_NoInspectionAvailable: Noinspectionsystemisavailableforobjectof type <class'app.models.orm.user.User'>```
The text was updated successfully, but these errors were encountered:
While playing around with the gino ORM on the shell, I kept encountering the
NoInspectionAvailable
error.Eventually, I traced this back to
@generic_repr
decorator and removing it fixed the problem.Here is the full stack trace:
The text was updated successfully, but these errors were encountered: