Skip to content

More human friendly "show tables" output for db cleanup - #38654

Merged
hussein-awala merged 1 commit into
apache:mainfrom
astronomer:better_drop_archived_table_list
Apr 1, 2024
Merged

More human friendly "show tables" output for db cleanup#38654
hussein-awala merged 1 commit into
apache:mainfrom
astronomer:better_drop_archived_table_list

Conversation

@jedcunningham

Copy link
Copy Markdown
Member

Don't print the string representation of a list, print out just the table names.

Before:

You have requested that we drop 4 archived tables prefixed with _airflow_deleted__.
This is irreversible. Consider backing up the tables first Show tables? (y/n): y ['_airflow_deleted__dag__20240401153649', '_airflow_deleted__dag_run__20240401153649', '_airflow_deleted__job__20240401153649', '_airflow_deleted__log__20240401153649'] 

After:

You have requested that we drop 4 archived tables prefixed with _airflow_deleted__.
This is irreversible. Consider backing up the tables first.
Show tables that will be dropped? (y/n): y
_airflow_deleted__dag__20240401153649
_airflow_deleted__dag_run__20240401153649
_airflow_deleted__job__20240401153649
_airflow_deleted__log__20240401153649

And with less than 3 tables...
Before:

You have requested that we drop the following archived tables ['_airflow_deleted__job__20240401153649', '_airflow_deleted__log__20240401153649'].
This is irreversible. Consider backing up the tables first 

After:

You have requested that we drop the following archived tables: _airflow_deleted__job__20240401153649, _airflow_deleted__log__20240401153649.
This is irreversible. Consider backing up the tables first.

@eladkaleladkal added this to the Airflow 2.9.0 milestone Apr 1, 2024
@hussein-awala
hussein-awala merged commit 39b3eb2 into apache:mainApr 1, 2024
ephraimbuddy pushed a commit that referenced this pull request Apr 2, 2024
@ephraimbuddyephraimbuddy added the type:improvement Changelog: Improvements label Apr 2, 2024
ephraimbuddy pushed a commit that referenced this pull request Apr 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:improvementChangelog: Improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@jedcunningham@potiuk@hussein-awala@eladkal@ephraimbuddy