dynamic-dags-tutorial
dynamic-dags-tutorial copied to clipboard
The way to delete a dynamically generated dag
I tried something like below;
globals()[dag_id] = None
However, it didn't work. Is there any way to delete a dynamically generated dag ?
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)