Skip to content

Commit

Permalink
Switch (back) to late imports (#27730)
Browse files Browse the repository at this point in the history
  • Loading branch information
blag authored Nov 22, 2022
1 parent 2aaccaf commit 093345c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
from airflow.models.dagcode import DagCode
from airflow.models.dagpickle import DagPickle
from airflow.models.dagrun import DagRun
from airflow.models.dataset import DagScheduleDatasetReference, DatasetDagRunQueue as DDRQ, DatasetModel
from airflow.models.operator import Operator
from airflow.models.param import DagParam, ParamsDict
from airflow.models.taskinstance import Context, TaskInstance, TaskInstanceKey, clear_task_instances
Expand Down Expand Up @@ -207,6 +206,8 @@ def get_dataset_triggered_next_run_info(
Given a list of dag_ids, get string representing how close any that are dataset triggered are
their next run, e.g. "1 of 2 datasets updated"
"""
from airflow.models.dataset import DagScheduleDatasetReference, DatasetDagRunQueue as DDRQ, DatasetModel

return {
x.dag_id: {
"uri": x.uri,
Expand Down Expand Up @@ -3340,6 +3341,8 @@ def dags_needing_dagruns(cls, session: Session) -> tuple[Query, dict[str, tuple[
you should ensure that any scheduling decisions are made in a single transaction -- as soon as the
transaction is committed it will be unlocked.
"""
from airflow.models.dataset import DagScheduleDatasetReference, DatasetDagRunQueue as DDRQ

# these dag ids are triggered by datasets, and they are ready to go.
dataset_triggered_dag_info = {
x.dag_id: (x.first_queued_time, x.last_queued_time)
Expand Down

0 comments on commit 093345c

Please sign in to comment.