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` (#39392)
  • Loading branch information
Taragolis committed May 4, 2024
1 parent 1d234aa commit 575c11e
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 575c11e

Please sign in to comment.