Skip to content

Commit d20f098

Browse files
committed
Add TODOs in providers code for Subdag code removal
Follow-up of apache#41390 (comment)
1 parent 7d3a402 commit d20f098

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

airflow/providers/cncf/kubernetes/operators/pod.py

+1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def _get_ti_pod_labels(context: Context | None = None, include_try_number: bool
495495
if include_try_number:
496496
labels.update(try_number=ti.try_number)
497497
# In the case of sub dags this is just useful
498+
# TODO: Remove this when the minimum version of Airflow is bumped to 3.0
498499
if getattr(context["dag"], "parent_dag", False):
499500
labels["parent_dag_id"] = context["dag"].parent_dag.dag_id # type: ignore[attr-defined]
500501

airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def create_labels_for_pod(context: dict | None = None, include_try_number: bool
202202
labels.update(try_number=ti.try_number)
203203

204204
# In the case of sub dags this is just useful
205+
# TODO: Remove this when the minimum version of Airflow is bumped to 3.0
205206
if getattr(context["dag"], "is_subdag", False):
206207
labels["parent_dag_id"] = context["dag"].parent_dag.dag_id
207208
# Ensure that label is valid for Kube,

airflow/providers/fab/auth_manager/security_manager/override.py

+2
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ def create_dag_specific_permissions(self) -> None:
10031003
dags = dagbag.dags.values()
10041004

10051005
for dag in dags:
1006+
# TODO: Remove this when the minimum version of Airflow is bumped to 3.0
10061007
root_dag_id = (getattr(dag, "parent_dag", None) or dag).dag_id
10071008
for resource_name, resource_values in self.RESOURCE_DETAILS_MAP.items():
10081009
dag_resource_name = self._resource_name(root_dag_id, resource_name)
@@ -2733,6 +2734,7 @@ def filter_roles_by_perm_with_action(self, action_name: str, role_ids: list[int]
27332734
).all()
27342735

27352736
def _get_root_dag_id(self, dag_id: str) -> str:
2737+
# TODO: The "root_dag_id" check can be remove when the minimum version of Airflow is bumped to 3.0
27362738
if "." in dag_id and hasattr(DagModel, "root_dag_id"):
27372739
dm = self.appbuilder.get_session.execute(
27382740
select(DagModel.dag_id, DagModel.root_dag_id).where(DagModel.dag_id == dag_id)

0 commit comments

Comments
 (0)