Fixed: "Cannot create DagRun for DAG … because the dag is not serialized" in Apache Airflow®
I ran a Dag file with python to try the Dag out with dag.test() in Apache Airflow® 3.4.0, and it stopped with Cannot create DagRun for DAG say_hello because the dag is not serialized. The Dag was created only inside the file's if __name__ == "__main__": block, where Airflow's own reading of the file never sees it. Here's how I found that out, and the small change that fixed it.
