Skip to content

Commit f875682

Browse files
committed
wip
1 parent 086eff2 commit f875682

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎vgi/_test_fixtures/aggregate/streaming.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222

2323
from __future__ import annotations
2424

25-
from dataclasses import dataclass
2625
from typing import Annotated, Any
2726

2827
import pyarrow as pa
29-
from vgi_rpc import ArrowSerializableDataclass
3028

3129
from vgi._test_fixtures.aggregate._common import SumState
3230
from vgi.aggregate_function import AggregateFunction

‎vgi/aggregate_function.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def window_batch(
484484
partition: WindowPartition,
485485
window_state: Any,
486486
params: ProcessParams[Any],
487-
) -> "pa.Array | list[Any]":
487+
) -> pa.Array | list[Any]:
488488
"""Compute the aggregate value for ``count`` consecutive output rows.
489489
490490
Default implementation calls :meth:`window` once per row. Override
@@ -559,7 +559,7 @@ def streaming_chunk(
559559
partition_key_count: int,
560560
order_key_count: int,
561561
params: ProcessParams[Any],
562-
) -> "pa.Array | list[Any]":
562+
) -> pa.Array | list[Any]:
563563
"""Process one chunk of streaming input.
564564
565565
Args:
@@ -585,6 +585,7 @@ def streaming_chunk(
585585
(which the framework converts via ``pa.array``). Each output
586586
value is the cumulative aggregate snapshot at that input
587587
row's position in its partition's order.
588+
588589
"""
589590
raise NotImplementedError(
590591
f"{cls.__name__}: Meta.streaming_partitioned=True requires overriding streaming_chunk()"

‎vgi/worker.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ class _StreamingSession:
399399

400400
def _encode_streaming_session(session: _StreamingSession) -> bytes:
401401
"""Pickle a session for FunctionStorage. ``func_cls`` is *not* pickled —
402-
it's resolved on the fly from the function name on cold reload."""
402+
it's resolved on the fly from the function name on cold reload.
403+
"""
403404
sink = pa.BufferOutputStream()
404405
with pa.ipc.new_stream(sink, session.output_schema) as writer:
405406
pass # schema-only stream is enough to round-trip the schema
@@ -604,7 +605,7 @@ def _build_scalar_result_batch(result_value: Any, output_schema: pa.Schema) -> p
604605

605606

606607
def _build_batch_result(
607-
results: "list[Any] | pa.Array",
608+
results: list[Any] | pa.Array,
608609
output_schema: pa.Schema,
609610
expected_count: int | None = None,
610611
) -> pa.RecordBatch:
@@ -2315,8 +2316,8 @@ def aggregate_streaming_chunk(
23152316
_streaming_persist_stats["n_cold_loads"] += 1
23162317
if payload is None:
23172318
raise OSError(
2318-
f"aggregate_streaming_chunk: unknown execution_id "
2319-
f"(streaming_open never ran or close already fired)"
2319+
"aggregate_streaming_chunk: unknown execution_id "
2320+
"(streaming_open never ran or close already fired)"
23202321
)
23212322
session = _decode_streaming_session(payload, func_cls)
23222323
_streaming_session_cache.put(request.execution_id, session)

0 commit comments

Comments
 (0)