From 381d70fb494fd7cd20ae46cfa2175f214a20b804 Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Sat, 18 Feb 2023 11:14:31 +1300 Subject: [PATCH] chore(sqla): Address performance tradeoff with eager loading (#23113) (cherry picked from commit f851e992cfcfd75786e236948c8678a013ff1265) --- superset/connectors/sqla/models.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 7ad5ad0312053..02bed344c9061 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -234,7 +234,6 @@ class TableColumn(Model, BaseColumn, CertificationMixin): table: Mapped["SqlaTable"] = relationship( "SqlaTable", back_populates="columns", - lazy="joined", # Eager loading for efficient parent referencing with selectin. ) is_dttm = Column(Boolean, default=False) expression = Column(MediumText()) @@ -449,7 +448,6 @@ class SqlMetric(Model, BaseMetric, CertificationMixin): table: Mapped["SqlaTable"] = relationship( "SqlaTable", back_populates="metrics", - lazy="joined", # Eager loading for efficient parent referencing with selectin. ) expression = Column(MediumText(), nullable=False) extra = Column(Text) @@ -551,13 +549,11 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho TableColumn, back_populates="table", cascade="all, delete-orphan", - lazy="selectin", # Only non-eager loading that works with bidirectional joined. ) metrics: Mapped[List[SqlMetric]] = relationship( SqlMetric, back_populates="table", cascade="all, delete-orphan", - lazy="selectin", # Only non-eager loading that works with bidirectional joined. ) metric_class = SqlMetric column_class = TableColumn