Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure back_populates between DagScheduleDatasetReference.dag and DagModel.schedule_dataset_references #39392

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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