Skip to content

Commit 0df7a6a

Browse files
rustyconoverclaude
andcommitted
fix(catalog): CI lint/mypy/docstring for companion-catalog additions
- companion.py: single-line summary (D205); type-annotate table_scan_branches_get params (mypy no-untyped-def). - ScanBranch docstring: order Attributes to match field order (source_* after writable) — DOC604/605. - ReadOnlyCatalogInterface docstring: document attach_catalogs (DOC601/603). - __init__: sorted AttachCatalogInfo import (I001). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3f69fec commit 0df7a6a

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

vgi/_test_fixtures/companion.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Copyright 2025, 2026 Query Farm LLC - https://query.farm
22

3-
"""Test fixture: a VGI catalog that advertises a companion catalog + a
4-
multi-branch table whose branches are catalog-table branches on that companion.
3+
"""Companion-catalog (lakehouse federation) test fixture.
4+
5+
A VGI catalog that advertises a companion catalog + a multi-branch table whose
6+
branches are catalog-table branches on that companion.
57
68
Exercises the lakehouse-federation feature end-to-end:
79
@@ -38,12 +40,14 @@
3840

3941
from vgi.catalog import (
4042
AttachCatalogInfo,
43+
AttachOpaqueData,
4144
Catalog,
4245
ReadOnlyCatalogInterface,
4346
ScanBranch,
4447
ScanBranchesResult,
4548
Schema,
4649
Table,
50+
TransactionOpaqueData,
4751
)
4852
from vgi.worker import Worker
4953

@@ -116,8 +120,8 @@ class CompanionCatalog(ReadOnlyCatalogInterface):
116120
def table_scan_branches_get(
117121
self,
118122
*,
119-
attach_opaque_data, # noqa: ANN001
120-
transaction_opaque_data, # noqa: ANN001
123+
attach_opaque_data: AttachOpaqueData,
124+
transaction_opaque_data: TransactionOpaqueData | None,
121125
schema_name: str,
122126
name: str,
123127
at_unit: str | None = None,

vgi/catalog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"""
88

99
from vgi.catalog.catalog_interface import (
10+
AttachCatalogInfo,
1011
AttachOpaqueData,
1112
CatalogAttachResult,
1213
CatalogDataVersionRelease,
1314
CatalogExample,
14-
AttachCatalogInfo,
1515
CatalogInfo,
1616
CatalogInterface,
1717
CatalogObject,

vgi/catalog/catalog_interface.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -932,14 +932,6 @@ class ScanBranch:
932932
table function). The C++ rewriter resolves this name against
933933
DuckDB's function catalog and binds it at optimize time. Empty
934934
string for a catalog-table branch.
935-
source_catalog: Catalog-table branch only — the attached catalog name
936-
(matches an :attr:`AttachCatalogInfo.alias`). ``None`` for function
937-
branches.
938-
source_schema: Catalog-table branch only — the schema of the source
939-
table. ``None`` for function branches.
940-
source_table: Catalog-table branch only — the base table name; its
941-
presence selects the catalog-table kind. ``None`` for function
942-
branches.
943935
positional_arguments: Positional arguments as PyArrow scalars,
944936
passed through to the function's ``bind``.
945937
named_arguments: Named arguments as PyArrow scalars.
@@ -960,6 +952,14 @@ class ScanBranch:
960952
remain refused on multi-branch tables regardless of this
961953
flag; the contract is INSERT-only until cross-arm
962954
semantics have customer-driven evidence.
955+
source_catalog: Catalog-table branch only — the attached catalog name
956+
(matches an :attr:`AttachCatalogInfo.alias`). ``None`` for function
957+
branches.
958+
source_schema: Catalog-table branch only — the schema of the source
959+
table. ``None`` for function branches.
960+
source_table: Catalog-table branch only — the base table name; its
961+
presence selects the catalog-table kind. ``None`` for function
962+
branches.
963963
ARROW_SCHEMA: Arrow IPC schema used to (de)serialize this branch over the wire.
964964
965965
"""
@@ -2306,6 +2306,8 @@ class ReadOnlyCatalogInterface(CatalogInterface):
23062306
settings: DuckDB setting specs the catalog declares.
23072307
secret_types: Secret type specs the catalog declares.
23082308
attach_option_specs: Attach option specs accepted at ``ATTACH`` time.
2309+
attach_catalogs: Companion catalogs (lakehouse federation) the client
2310+
should ATTACH when this catalog attaches.
23092311
catalog: Optional declarative `[`Catalog`][]` object describing the
23102312
catalog's schemas, tables, and views.
23112313
catalog_create: DDL stub that raises `[`CatalogReadOnlyError`][].

0 commit comments

Comments
 (0)