Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TypeError with inspect methods=True #916

Closed
thorstenkampe opened this issue Jan 13, 2021 · 1 comment · Fixed by #919
Closed

[BUG] TypeError with inspect methods=True #916

thorstenkampe opened this issue Jan 13, 2021 · 1 comment · Fixed by #919

Comments

@thorstenkampe
Copy link

The below code gives a TypeError on a SQAlchemy engine with methods=True

import sqlalchemy as sa

engine = sa.create_engine('sqlite://')
rich.inspect(engine, methods=True)
Traceback (most recent call last):
  File "rich-test.py", line 18, in <module>
    rich.inspect(engine, methods=True)
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\site-packages\rich\__init__.py", line 113, in inspect
    _console.print(_inspect)
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\site-packages\rich\console.py", line 1202, in print
    renderables = self._collect_renderables(
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\site-packages\rich\console.py", line 1067, in _collect_renderables
    renderable = rich_cast()
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\site-packages\rich\_inspect.py", line 82, in __rich__
    RenderGroup(*self._render()),
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\site-packages\rich\_inspect.py", line 181, in _render
    _signature_text = self._get_signature(key, value)
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\site-packages\rich\_inspect.py", line 91, in _get_signature
    _signature = str(signature(obj)) + ":"
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\inspect.py", line 3130, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\inspect.py", line 2879, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\inspect.py", line 2421, in _signature_from_callable
    sig = _signature_from_callable(
  File "F:\scoop\apps\miniconda3\current\envs\main\lib\inspect.py", line 2254, in _signature_from_callable
    raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: <member '__call__' of '_SchemaTranslateMap' objects> is not a callable object
@willmcgugan
Copy link
Collaborator

Seems there was an attribute that was callable but failed to introspect the signature. Should be fixed in 9.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants