Skip to content

Commit 09519bc

Browse files
rustyconoverclaude
andcommitted
fix(test-fixtures): lint/format/mypy + regen landing golden
- ruff format cache.py; drop a now-redundant local `from typing import Any`. - Annotate the projection fixture's `full` dict as `dict[str, list[Any]]` so `RecordBatch.from_pydict` type-checks (was inferred `dict[str, object]`). - Regenerate tests/landing/describe.expected.json for the 4 new cache_partition_* example functions (landing-conformance drift guard). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a8e8192 commit 09519bc

2 files changed

Lines changed: 53 additions & 10 deletions

File tree

‎tests/landing/describe.expected.json‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"attach_options": [],
55
"counts": {
6-
"functions": 199,
6+
"functions": 203,
77
"schemas": 2,
88
"tables": 59,
99
"views": 3
@@ -1524,6 +1524,54 @@
15241524
"name": "cache_parallel",
15251525
"type": "table"
15261526
},
1527+
{
1528+
"args": [
1529+
{
1530+
"desc": "Rows per (region, year) partition",
1531+
"name": "rows_per_partition",
1532+
"type": "int64"
1533+
}
1534+
],
1535+
"doc": "Per-partition cacheable over (region, year) SINGLE_VALUE partition columns",
1536+
"name": "cache_partition_multicol",
1537+
"type": "table"
1538+
},
1539+
{
1540+
"args": [
1541+
{
1542+
"desc": "Rows per country partition",
1543+
"name": "rows_per_country",
1544+
"type": "int64"
1545+
}
1546+
],
1547+
"doc": "Per-partition cacheable; work-queue fan-out (parallel capture); one NULL partition",
1548+
"name": "cache_partition_parallel",
1549+
"type": "table"
1550+
},
1551+
{
1552+
"args": [
1553+
{
1554+
"desc": "Rows per country partition",
1555+
"name": "rows_per_country",
1556+
"type": "int64"
1557+
}
1558+
],
1559+
"doc": "Per-partition cacheable with projection pushdown + explicit partition_values",
1560+
"name": "cache_partition_proj",
1561+
"type": "table"
1562+
},
1563+
{
1564+
"args": [
1565+
{
1566+
"desc": "Rows per country partition",
1567+
"name": "rows_per_country",
1568+
"type": "int64"
1569+
}
1570+
],
1571+
"doc": "Per-partition cacheable single-value-partitioned result (vgi.cache.partition_scope)",
1572+
"name": "cache_partition_scope",
1573+
"type": "table"
1574+
},
15271575
{
15281576
"args": [
15291577
{

‎vgi/_test_fixtures/table/cache.py‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import itertools
2828
import struct
2929
from dataclasses import dataclass
30-
from typing import Annotated, ClassVar, cast
30+
from typing import Annotated, Any, ClassVar, cast
3131

3232
import pyarrow as pa
3333
from vgi_rpc import ArrowSerializableDataclass
@@ -1332,7 +1332,6 @@ def process(
13321332
first_batch = state.current_index == 0
13331333
size = min(state.remaining, cls.BATCH_SIZE)
13341334
from decimal import Decimal
1335-
from typing import Any
13361335

13371336
ids: list[int] = []
13381337
tags: list[list[int] | None] = []
@@ -1634,9 +1633,7 @@ class _CachePartitionParallelState(ArrowSerializableDataclass):
16341633

16351634

16361635
@bind_fixed_schema
1637-
class CachePartitionParallelFunction(
1638-
TableFunctionGenerator[CachePartitionParallelArgs, _CachePartitionParallelState]
1639-
):
1636+
class CachePartitionParallelFunction(TableFunctionGenerator[CachePartitionParallelArgs, _CachePartitionParallelState]):
16401637
"""Per-partition cacheable; work-queue fan-out across workers; includes a NULL partition."""
16411638

16421639
FIXED_SCHEMA: ClassVar[pa.Schema] = pa.schema(
@@ -1731,9 +1728,7 @@ class _CachePartitionMultiColState(ArrowSerializableDataclass):
17311728

17321729
@init_single_worker
17331730
@bind_fixed_schema
1734-
class CachePartitionMultiColFunction(
1735-
TableFunctionGenerator[CachePartitionMultiColArgs, _CachePartitionMultiColState]
1736-
):
1731+
class CachePartitionMultiColFunction(TableFunctionGenerator[CachePartitionMultiColArgs, _CachePartitionMultiColState]):
17371732
"""Per-partition cacheable over TWO SINGLE_VALUE partition columns (region, year)."""
17381733

17391734
FIXED_SCHEMA: ClassVar[pa.Schema] = pa.schema(
@@ -1849,7 +1844,7 @@ def process(
18491844
country = _PSCOPE_PROJ_COUNTRIES[state.country_idx]
18501845
rpc = params.args.rows_per_country
18511846
base = state.country_idx * 1_000_000
1852-
full = {
1847+
full: dict[str, list[Any]] = {
18531848
"country": [country] * rpc,
18541849
"sales": [base + i for i in range(rpc)],
18551850
"extra": [base + 500 + i for i in range(rpc)],

0 commit comments

Comments
 (0)