From 8cf69a5347c5907af5c1ed5c702cef651911cfee Mon Sep 17 00:00:00 2001 From: "Edgar Y. Walker" Date: Sat, 28 Nov 2026 17:05:55 -0800 Subject: [PATCH 1/2] docs: define the public interface and Arrow list type rules --- changelog.d/ITL-1550.md | 4 ++++ docs/api/index.md | 9 +++++++++ docs/concepts/sources.md | 21 +++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 changelog.d/ITL-1550.md diff --git a/changelog.d/ITL-1550.md b/changelog.d/ITL-1550.md new file mode 100644 index 000000000..5630fcacc --- /dev/null +++ b/changelog.d/ITL-1550.md @@ -0,0 +1,4 @@ +### Changed + +- Documented which names form Orcapod's public interface and how provisional features may change. +- Documented how Arrow list item names, metadata and nullability affect column types and hashes. diff --git a/docs/api/index.md b/docs/api/index.md index 206afe787..a8a1612e2 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -3,6 +3,15 @@ This section contains the full API reference for Orcapod, auto-generated from source code docstrings. +## Public interface + +Orcapod's public interface consists of exactly the objects, methods, properties and +arguments shown in this API reference. A name absent from the reference is internal, +even if it has no leading underscore, and may change or disappear in any release. +Features marked provisional in the documentation are public and may change in a later +release, as described for [provisional operators](../concepts/operators.md#provisional-operators) +and [provisional sources](../concepts/sources.md#provisional-sources). + ## Package structure The top-level `orcapod` namespace exposes the most commonly used entry points diff --git a/docs/concepts/sources.md b/docs/concepts/sources.md index 6da884ab0..464c0a5a0 100644 --- a/docs/concepts/sources.md +++ b/docs/concepts/sources.md @@ -226,6 +226,27 @@ For example, `pa.large_list(pa.field("item", pa.int64(), nullable=False))` decla required items. That field has a different Arrow schema identity from the default nullable item. Use matching nested flags when joining sources or binding a slot. +The inner field's `nullable` flag is part of a list column's type. Orcapod preserves the +inner field's name and metadata as given and ignores both when hashing or comparing list +column types. For example, changing the inner field name from `item` to `element` leaves +the pipeline hash unchanged. + +```python +import pyarrow as pa + +from orcapod.sources import ArrowTableSource + + +def list_source(field_name): + list_type = pa.large_list(pa.field(field_name, pa.int64())) + table = pa.table({"values": pa.array([[1, 2]], type=list_type)}) + return ArrowTableSource(table) + + +print(list_source("item").pipeline_hash() == list_source("element").pipeline_hash()) +# True +``` + When `DictSource` or `ListSource` builds a source from Python values, it checks the first row for a Python `float` in a top-level column declared `numpy.float32` or `numpy.float32 | None` in the Python schema. If it finds one, Orcapod issues a From fe83c9b11266db39f8378b468212a4cb3e9d9aa9 Mon Sep 17 00:00:00 2001 From: "Edgar Y. Walker" Date: Sat, 28 Nov 2026 17:58:38 -0800 Subject: [PATCH 2/2] docs(sources): clarify Arrow list item identity checks --- docs/concepts/sources.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/docs/concepts/sources.md b/docs/concepts/sources.md index 464c0a5a0..b5a8cfea7 100644 --- a/docs/concepts/sources.md +++ b/docs/concepts/sources.md @@ -227,9 +227,17 @@ required items. That field has a different Arrow schema identity from the defaul nullable item. Use matching nested flags when joining sources or binding a slot. The inner field's `nullable` flag is part of a list column's type. Orcapod preserves the -inner field's name and metadata as given and ignores both when hashing or comparing list -column types. For example, changing the inner field name from `item` to `element` leaves -the pipeline hash unchanged. +inner field's name and metadata in the source's Arrow schema. When hashing the schema, +Orcapod ignores the item name and ordinary metadata. An Arrow extension identifier, +stored in `ARROW:extension:*` metadata, contributes to the hash. + +Streaming joins compare the types of incoming user columns without considering list item +names or metadata. They check source-info columns more strictly. When validating a +materialized operator result against its declared schema before caching it, Orcapod also +checks the item names and metadata of the fields it validates. + +This example compares the original source's pipeline hash with the hash after each schema +change. ```python import pyarrow as pa @@ -237,14 +245,24 @@ import pyarrow as pa from orcapod.sources import ArrowTableSource -def list_source(field_name): - list_type = pa.large_list(pa.field(field_name, pa.int64())) - table = pa.table({"values": pa.array([[1, 2]], type=list_type)}) - return ArrowTableSource(table) +def list_source(field_name="item", *, nullable=True, metadata=None): + item = pa.field(field_name, pa.binary(16), nullable=nullable, metadata=metadata) + values = pa.array([[bytes(16)]], type=pa.large_list(item)) + return ArrowTableSource(pa.table({"values": values})) -print(list_source("item").pipeline_hash() == list_source("element").pipeline_hash()) -# True +original = list_source().pipeline_hash() +print("Renamed item:", original == list_source("element").pipeline_hash()) +# Renamed item: True +with_note = list_source(metadata={"note": "example"}).pipeline_hash() +print("Ordinary metadata:", original == with_note) +# Ordinary metadata: True +print("Required item:", original == list_source(nullable=False).pipeline_hash()) +# Required item: False + +uuid_metadata = {"ARROW:extension:name": "arrow.uuid", "ARROW:extension:metadata": ""} +print("UUID extension:", original == list_source(metadata=uuid_metadata).pipeline_hash()) +# UUID extension: False ``` When `DictSource` or `ListSource` builds a source from Python values, it checks the