Airflow Remove Example Dags

When you start your local airflow based on the official documentation, the airflow will fill the db with a bunch of examples. If you want to remove them, first you need to find the airflow.cfg find under the airflow home directory (usually it is $HOME/airflow) and change the line load_examples = True to load_examples = False. After the change, however, the examples are still in you airflow’s DB. You need to run airflow resetdb to reset the airflow DB. Finally the examples are gone.

Python how to list files under a directgory

There are so many ways, but in python 3 looks the most popular way is using pathlib. Here is an example to list all
files starting with bar under dir /foo

1
[x.absolute() for x in pathlib.Path("/foo").glob("bar*")]