Search before asking
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?
Search before asking
Motivation
When reading code that uses
CatalogFactory.create(), I cannot follow the returned table through IDE completion and go-to-definition:On
masterat10cf6ebc7, Pyright reportsUnknownfortableandread_builder.Catalog.get_table()declares'Table'as its return type, but the module does not importTable. The annotations forDatabaseandTableQueryAuthResulthave 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
CatalogAPI, 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?