Skip to content

Conversation

@timsaucer
Copy link
Member

Which issue does this PR close?

Follow on to #1156

Rationale for this change

We currently support the following kinds of providers: Catalog, Schema, and Table. There is one more in the heirarchy, CatalogProviderList. This adds the missing support.

What changes are included in this PR?

Following the same patterns as in CatalogProvider (and others) this adds support for Python and Rust based CatalogProviderList. It adds the option to register a new provider list with the session context.

Are there any user-facing changes?

New addition only.

@timsaucer timsaucer marked this pull request as draft February 3, 2026 13:55
@timsaucer timsaucer marked this pull request as ready for review February 3, 2026 15:55
Copy link
Contributor

@nuno-faria nuno-faria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

...

@abstractmethod
def catalog(self, name: str) -> Catalog | None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the return type here be CatalogProvider?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! This should be any of the 3 returnable types, including Catalog.

...

def register_catalog( # noqa: B027
self, name: str, catalog: CatalogProviderExportable | CatalogProvider | Catalog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is the Catalog type here correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, especially if they want to register an in-memory catalog they created with the static method.


class CustomCatalogProviderList(dfn.catalog.CatalogProviderList):
def __init__(self):
self.catalogs = {"my_catalog": CustomCatalogProvider()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could have an additional catalog just to show it supports multiple ones.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a different catalog type in the register test to follow.

@timsaucer
Copy link
Member Author

Thanks for the review @nuno-faria !

@timsaucer timsaucer merged commit 8fc9436 into apache:main Feb 9, 2026
17 checks passed
@timsaucer timsaucer deleted the feat/catalog-provider-list branch February 9, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants