How to Solve NameError: name 'SubDagOperator' is not defined -- airflow

Solution: Import the 'SubDagOperator' module

# Add the following line to the top of your code
from airflow.operators.subdag import SubDagOperator

 

For more information:
airflow SubDagOperator