there should be a 
```
if not isinstance(bucket_type, BucketType):
   foo
```
check here