uranusjr commented on a change in pull request #20795:
URL: https://github.com/apache/airflow/pull/20795#discussion_r781938763



##########
File path: airflow/api/common/experimental/mark_tasks.py
##########
@@ -194,13 +196,15 @@ def get_subdag_runs(
 
             current_task = current_dag.get_task(task_id)
             if isinstance(current_task, SubDagOperator) or 
current_task.task_type == "SubDagOperator":
+                if TYPE_CHECKING:
+                    assert current_task.subdag

Review comment:
       The most generally accepted way to work around this is to actually use 
`assert` _without_ the if-guard; this is strictly for the linters, so `assert` 
being optimised in `-O` is totally a good thing. This is why Airflow’s “never 
use assert ever” rule has not sit well with me; assert exists for a reason, and 
_this is exactly it_.




-- 
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]


Reply via email to