Closed lame closed 2 years ago
Due to the following lines:
https://github.com/graphql-python/graphene-sqlalchemy/blob/421f8e48d169a91e20328108c6f56ae0987d21b8/graphene_sqlalchemy/converter.py#L19-L22
Graphene will break with the following message when SQLAlchemy-Utils is installed:
SQLAlchemy-Utils
Exception: Don't know how to convert the SQLAlchemy field Foo.bar (<class 'sqlalchemy.sql.schema.Column'>)
where Foo.bar is a TSTZRANGE type as follows:
In [11]: from script import base_script ...: from sqlalchemy.inspection import inspect as sqlalchemyinspect ...: from graphene_sqlalchemy.converter import convert_sqlalchemy_type ...: from singledispatch import _compose_mro ...: from foo import Foo ...: ...: inspected_model = sqlalchemyinspect(Foo) ...: print(inspected_model.columns.items()[5]) ...: name, column = inspected_model.columns.items()[5] ...: model_hierarchy = _compose_mro( ...: column.type.__class__, convert_sqlalchemy_type.registry.keys() ...: ) ...: reg = convert_sqlalchemy_type.registry ...: for model in model_hierarchy: ...: if model in reg: ...: print(model, reg[model]) ...: ...: print(model_hierarchy) ...: ('bar', Column('bar', TSTZRANGE(), table=<foos>, nullable=False)) <class 'object'> <function convert_sqlalchemy_type at 0x108f88560> [<class 'sqlalchemy.dialects.postgresql.ranges.TSTZRANGE'>, <class 'sqlalchemy.dialects.postgresql.ranges.RangeOperators'>, <class 'sqlalchemy.sql.type_api.TypeEngine'>, <class 'sqlalchemy.sql.visitors.Visitable'>, <class 'object'>]
Should be fixed in 3.0.0b2
3.0.0b2
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics referencing this issue.
Due to the following lines:
https://github.com/graphql-python/graphene-sqlalchemy/blob/421f8e48d169a91e20328108c6f56ae0987d21b8/graphene_sqlalchemy/converter.py#L19-L22
Graphene will break with the following message when
SQLAlchemy-Utils
is installed:where Foo.bar is a TSTZRANGE type as follows: