Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
chore(sqla): Address performance tradeoff with eager loading (apache#…
Browse files Browse the repository at this point in the history
…23113)

(cherry picked from commit f851e99)
  • Loading branch information
john-bodley committed Feb 17, 2023
1 parent 3a5783a commit 0dbce5f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0dbce5f

Please sign in to comment.