Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions airflow-core/src/airflow/jobs/scheduler_job_runner.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bujjibabukatta - should we add unit-testing to this?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the tests that were written for this PR (which yours mirrors): https://github.com/apache/airflow/pull/60773/changes

Original file line number Diff line number Diff line change
Expand Up @@ -2133,6 +2133,16 @@ def _create_dagruns_for_partitioned_asset_dags(self, session: Session) -> set[st
partition_dag_ids: set[str] = set()
pending_apdr_ids = [apdr.id for apdr in pending_apdrs]

evaluator = AssetEvaluator(session)
apdr_query = (
select(AssetPartitionDagRun)
.where(AssetPartitionDagRun.created_dag_run_id.is_(None))
)
for apdr in session.scalars(
with_row_locks(apdr_query, of=AssetPartitionDagRun, session=session, skip_locked=True)
):
if TYPE_CHECKING:
assert apdr.target_dag_id
# {"dag_id": Serialized Dag}
serialized_dags: dict[str, SerializedDAG] = {}
for serdag in serdags_by_dag_id.values():
Expand Down
Loading