New function feature to mimic awswrangler.catalog.delete_table_if_exists - so we can delete the table only but keep the S3 data (similar to an SQL query of DROP TABLE IF EXISTS [TABLE_NAME]).
def delete_table(table: str, database: str, boto3_session=None):
"""
Deletes a table from an Athena database.
Args:
table (str): The table name to drop.
database (str): The database name.
Returns:
True if table exists and is deleted, False if table
does not exist
"""
if table in list(tables(database=database, limit=None)["Table"]):
wr.catalog.delete_table_if_exists(
database=database, table=table, boto3_session=boto3_session
)
return True
else:
return False
New function feature to mimic awswrangler.catalog.delete_table_if_exists - so we can delete the table only but keep the S3 data (similar to an SQL query of
DROP TABLE IF EXISTS [TABLE_NAME]
).Have updated the README.md and CHANGELOG.md too.