cleanup

Astro SDKCertified

Clean up temporary tables once either the DAG or upstream tasks are done

View on GitHub

Last Updated: Aug. 18, 2022

Access Instructions

Install the Astro SDK provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

tables_to_cleanupList[astro.sql.table.Table]A list of tables to cleanup, defaults to waiting for all upstream tasks to finish
kwargsDictAny keyword arguments supported by the BaseOperator is supported (e.g queue, owner).

Documentation

Clean up temporary tables once either the DAG or upstream tasks are done. The cleanup operator allows for two possible scenarios: Either a user wants to clean up a specific set of tables during the DAG run, or the user wants to ensure that all temporary tables are deleted once the DAG run is finished. The idea here is to ensure that even if a user doesn't have access to a "temp" schema, that astro does not leave hanging tables once execution is done.

Was this page helpful?