Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
Decorator
API that allows users of this library to register decorator implementations ofTableProvider
.Decorators are useful for overriding functionality of existing
TableProvider
implementations. Sometimes, a user may implementedMaterialized
orListingTableLike
for aTableProvider
, but then wrap this type with a decorator that doesn't implement either. In this case, whether or not the inner table implementsMaterialized
orTableProvider
can only be known at runtime by inspecting the innerTableProvider
.To simplify dealing with such cases, the user may register their decorator using
register_decorator
. For such types, if thecast_to_listing_table
andcast_to_materialized
functions fail, it will then check if the table is a decorator. If so, it will recursively check the inner table as well.