moj-analytical-services / pydbtools

Python version of dbtools
https://moj-analytical-services.github.io/pydbtools/
10 stars 2 forks source link

CCDE-332: Create ability to drop glue table and contents in one function #54

Closed isichei closed 1 year ago

isichei commented 2 years ago

pydbtools should have a function to drop table and its s3 contents you can do this in aws-wrangler.

I wrote a basic version just in a random script for my current project but it would be good to be properly in pydbtools.

def big_drop(table, db_name):
    path = wr.catalog.get_table_location(database=db_name, table=table)
    wr.s3.delete_objects(path)
    wr.catalog.delete_table_if_exists(database=db_name, table=table)

Would also be good to…

mratford commented 2 years ago

https://github.com/moj-analytical-services/pydbtools/pull/58