PynamoDB icon indicating copy to clipboard operation
PynamoDB copied to clipboard

Question: Is there a way to wait until a table is deleted?

Open HyeongGun opened this issue 5 years ago • 3 comments

Hi ! I am new to PynamoDB and I was wondering if there is a way to wait until a table is deleted. There is a parameter for create_table, however, It seems there is no way to wait until a table is deleted. I can use dynamodb waiter instead but it would be nice if there is the same feature as create_table! Thank you for the kind library and your best efforts.

 @classmethod
    def create_table(cls, wait=False, read_capacity_units=None, write_capacity_units=None):
    @classmethod
    def delete_table(cls):
        """
        Delete the table for this model
        """
        return cls._get_connection().delete_table()

HyeongGun avatar Jul 16 '18 07:07 HyeongGun

Are there any updates on that? @ikonst Any suggestion on how that might be implemented?

slyapustin avatar Nov 23 '21 17:11 slyapustin

I'm curious as to the motivation. In what cases is this useful? (especially in light of the scope of the library)

ikonst avatar Nov 24 '21 04:11 ikonst

I think the idea behind that request is to have two methods with consistent implementation.

As of now, we have an option to wait in the create_table() but there is no such option in the delete_table() which introduce some confusion (especially for the beginners).

I'm totally fine using a custom workaround in my code. And I think that is not a common use-case for that library and for DynamoDB in general, but it will make implementation a bit intuitive.

slyapustin avatar Nov 24 '21 08:11 slyapustin