Skip to content

Commit

Permalink
remove old code that only works with sqlalchemy 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ckk3 committed Nov 24, 2024
1 parent be77996 commit fb6a580
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/strawberry_sqlalchemy_mapper/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
from strawberry.dataloader import DataLoader


# import label from sqlalchemy if sqlalchemy version is equal 2
# SQLA_VERSION = version.parse(sqlalchemy.__version__)
# SQLA2 = SQLA_VERSION >= version.parse("2.0")
# if SQLA2:
# from sqlalchemy import label

class StrawberrySQLAlchemyLoader:
"""
Creates DataLoader instances on-the-fly for SQLAlchemy relationships
Expand Down Expand Up @@ -99,8 +93,6 @@ async def load_fn(keys: List[Tuple]) -> List[Any]:
# This query returns every row equal (self_model.key, related_model)
query = (
select(
# label(self_model_key_label, getattr(
# self_model, self_model_key)),
getattr(self_model, self_model_key).label(self_model_key_label),
related_model
)
Expand Down

0 comments on commit fb6a580

Please sign in to comment.