dynamic-dags-tutorial icon indicating copy to clipboard operation
dynamic-dags-tutorial copied to clipboard

The way to delete a dynamically generated dag

Open EugeneChung opened this issue 4 years ago • 1 comments

I tried something like below;

globals()[dag_id] = None

However, it didn't work. Is there any way to delete a dynamically generated dag ?

EugeneChung avatar Jun 23 '21 03:06 EugeneChung

maybe to late but I simple clean the file from the cache

    fileList = glob.glob('dags/__pycache__/' + config['DagId'] + '*.pyc')

    for filePath in fileList:
        try:
            print('clean up cache: ' + filePath)
            os.remove(filePath)
        except:
            print("Error while deleting file : ", filePath)

zBrainiac avatar Jan 05 '22 15:01 zBrainiac