diff --git a/airflow/models/dag.py b/airflow/models/dag.py index 4abf24af52537..f4e593dde91da 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -770,6 +770,16 @@ def get_is_paused(self, session=NEW_SESSION) -> None: """Return a boolean indicating whether this DAG is paused.""" return session.scalar(select(DagModel.is_paused).where(DagModel.dag_id == self.dag_id)) + @provide_session + def get_bundle_name(self, session=NEW_SESSION) -> str: + """Return the name of the bundle this DAG is in.""" + return session.scalar(select(DagModel.bundle_name).where(DagModel.dag_id == self.dag_id)) + + @provide_session + def get_latest_bundle_version(self, session=NEW_SESSION) -> str | None: + """Return the latest version of the bundle this DAG is in.""" + return session.scalar(select(DagModel.latest_bundle_version).where(DagModel.dag_id == self.dag_id)) + @methodtools.lru_cache(maxsize=None) @classmethod def get_serialized_fields(cls):