Hi! I'm using this library with Fast API and experiencing an issue with filters with joins. Sometimes this piece of code returns None:
@classmethod
def _aliases_from_query(cls, query: Query) -> 'Dict[str, _MapperEntity]':
"""
Get aliases from SQLAlchemy query.
Args:
query: SQLAlchemy query.
Returns:
Dictionary of model aliases.
"""
aliases = {
(mapper._target, mapper.name): mapper.entity
for mapper in query._join_entities
}
return aliases
mapper.entity is None from time to time. This is because it uses weakref and entity object gets garbage collected or something like that I didn't dig that much. When I try to join the table once more sqlalchemy complains that it's already joined. Maybe you @art1415926535 could give some advice on how to fix that? Thanks
Hi! I'm using this library with Fast API and experiencing an issue with filters with joins. Sometimes this piece of code returns None:
mapper.entity
is None from time to time. This is because it uses weakref and entity object gets garbage collected or something like that I didn't dig that much. When I try to join the table once more sqlalchemy complains that it's already joined. Maybe you @art1415926535 could give some advice on how to fix that? Thanks