ashb commented on issue #12387: URL: https://github.com/apache/airflow/issues/12387#issuecomment-731852616
> I simply just want to get a list of currently registered DAGs. Why? And why do you want to do this _whenever your dag is parsed_? (Hint: This is about once a second.!) It is considered good pratice to avoid any unnecessary code at the top level of your DAG file. If you _absolutely_ need this at the top level (i.e. outside of a task's execute function) then use the DagModel DB table. DAG Bag is not designed for this purpose --- as you've found out it is for parsing dags from files on disk. You have by very definition created a recursion, as you are creating a new instance of a DagBag, which parses the dag file. which then creates a new DagBag etc. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
