Skip to content

[Feature] Improve PyPaimon catalog API type annotations #10024

Description

@wangzhigang1999

Search before asking

  • I searched existing issues and pull requests and found no similar report.

Motivation

When reading code that uses CatalogFactory.create(), I cannot follow the returned table through IDE completion and go-to-definition:

from pypaimon.catalog.catalog_factory import CatalogFactory

catalog = CatalogFactory.create({"warehouse": "/tmp/warehouse"})
table = catalog.get_table("db.table")
read_builder = table.new_read_builder()

On master at 10cf6ebc7, Pyright reports Unknown for table and read_builder. Catalog.get_table() declares 'Table' as its return type, but the module does not import Table. The annotations for Database and TableQueryAuthResult have the same problem. Other catalog methods omit parameter or return annotations, including snapshot, partition and tag operations.

Solution

Add the missing type imports and annotations to the Catalog API, and align the corresponding methods in the filesystem, JDBC and REST implementations. Keep the optional database-property type consistent through the REST API and request object.

The scope is the catalog API and its implementation signatures. This should let callers follow the existing table and builder APIs through static type information.

Are you willing to submit a PR?

  • I am willing to submit a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions