Skip to content

Commit

Permalink
Configure back_populates between DagScheduleDatasetReference.dag
Browse files Browse the repository at this point in the history
…and `DagModel.schedule_dataset_references` (apache#39392)
  • Loading branch information
Taragolis authored and RodrigoGanancia committed May 10, 2024
1 parent baa7f40 commit 8e794b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -3668,6 +3668,7 @@ class DagModel(Base):
)
schedule_dataset_references = relationship(
"DagScheduleDatasetReference",
back_populates="dag",
cascade="all, delete, delete-orphan",
)
schedule_datasets = association_proxy("schedule_dataset_references", "dataset")
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class DagScheduleDatasetReference(Base):
updated_at = Column(UtcDateTime, default=timezone.utcnow, onupdate=timezone.utcnow, nullable=False)

dataset = relationship("DatasetModel", back_populates="consuming_dags")
dag = relationship("DagModel")
dag = relationship("DagModel", back_populates="schedule_dataset_references")

queue_records = relationship(
"DatasetDagRunQueue",
Expand Down

0 comments on commit 8e794b3

Please sign in to comment.