uranusjr commented on code in PR #41390:
URL: https://github.com/apache/airflow/pull/41390#discussion_r1713550151
##########
airflow/providers/fab/auth_manager/security_manager/override.py:
##########
@@ -1073,7 +1073,10 @@ def create_dag_specific_permissions(self) -> None:
dags = dagbag.dags.values()
for dag in dags:
- root_dag_id = dag.parent_dag.dag_id if dag.parent_dag else
dag.dag_id
+ if hasattr(dag, "parent_dag") and dag.parent_dag:
+ root_dag_id = dag.parent_dag.dag_id
+ else:
+ root_dag_id = dag.dag_id
Review Comment:
```suggestion
root_dag_id = (getattr(dag, "parent_dag", None) or dag).dag_id
```
##########
airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py:
##########
@@ -202,7 +202,7 @@ def create_labels_for_pod(context: dict | None = None,
include_try_number: bool
labels.update(try_number=ti.try_number)
# In the case of sub dags this is just useful
- if context["dag"].is_subdag:
+ if hasattr(context["dag"], "is_subdag") and context["dag"].is_subdag:
Review Comment:
```suggestion
if getattr(context["dag"], "is_subdag", False):
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]