Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0bf5e72
test(operators): several columns, names, mappings and inputs, in ever…
Nov 18, 2026
03f4a26
test(sources, function_pod, pipeline): several tags, keys, inputs and…
Nov 18, 2026
e8ae621
test(operators): async rows equal sync rows in every several-input ca…
Nov 18, 2026
f40e1af
Merge branch 'eywalker/itl-1236-tests-audit-every-argument-that-takes…
Nov 18, 2026
8129cfa
test(operators): issue ids for the defects found (ITL-1243, ITL-1247)…
Nov 18, 2026
86a99fc
Merge branch 'eywalker/itl-1236-tests-audit-every-argument-that-takes…
Nov 18, 2026
ec9c140
test(operators): type the results helper by Mapping (ITL-1236)
Nov 18, 2026
7217f5c
Merge branch 'eywalker/itl-1236-tests-audit-every-argument-that-takes…
Nov 18, 2026
56213e8
test(data_tags, streams, sources): several nullable data-tags, list-v…
Nov 18, 2026
aa7fa71
test(operators): column order of sync rows, async rows and keys, per …
Nov 18, 2026
b66ee60
Merge branch 'eywalker/itl-1236-tests-audit-every-argument-that-takes…
Nov 18, 2026
ea4814f
test(sources, pipeline): compare key orders with each other; check bo…
Nov 18, 2026
86ed772
Merge branch 'eywalker/itl-1236-part2-sources-pods-bind' into eywalke…
Nov 18, 2026
d896a18
test(operators): ITL-1249 for the column order xfails; an operator no…
Nov 18, 2026
fb75b54
Merge branch 'eywalker/itl-1236-tests-audit-every-argument-that-takes…
Nov 18, 2026
74cef31
Merge branch 'eywalker/itl-1236-part2-sources-pods-bind' into eywalke…
Nov 18, 2026
e1800eb
test(operators): one column-order test per arrangement, xfail only wh…
Nov 18, 2026
4bf0e18
Merge branch 'eywalker/itl-1236-tests-audit-every-argument-that-takes…
Nov 18, 2026
3702e65
test(function_pod, sources, pipeline): weighted outputs, async arrang…
Nov 18, 2026
adf6650
Merge branch 'eywalker/itl-1236-part2-sources-pods-bind' into eywalke…
Nov 18, 2026
88f810b
test(data_tags, streams): narrowing checked against the computed sche…
Nov 18, 2026
41def2c
test(function_pod): pin the output schema as a set of named, typed ou…
Nov 18, 2026
6fd7584
test(function_pod): the ITL-1253 xfail names ITL-1256 and expects onl…
Nov 18, 2026
91c49ec
Merge remote-tracking branch 'origin/main' into eywalker/itl-1236-par…
Nov 18, 2026
54708fe
test(sources): compare whole record ids with canonical JSON built fro…
Nov 18, 2026
c05922f
Merge remote-tracking branch 'origin/eywalker/itl-1236-part2-sources-…
Nov 19, 2026
766d5ee
Merge remote-tracking branch 'origin/main' into HEAD
Nov 19, 2026
b85a996
Merge commit '766d5ee2' into eywalker/itl-1244-function-pods-the-orde…
Nov 19, 2026
15eec2b
Merge origin/main (PR 444 squashed as 3394a209, PR 448 as a026d31f) i…
Nov 19, 2026
64d3ccf
test: several-items arrangements for the data-tag, source, stream-met…
Nov 19, 2026
88f4588
test(function_pod): ITL-1246 strict xfail scoped to the arrangement t…
Nov 19, 2026
d265388
Merge origin/main (PR 450 squashed as 84cc52cd) into ITL-1244
Nov 19, 2026
3c5f492
docs: a same-typed swap of output keys needs a MAJOR version bump
Nov 19, 2026
3241cc5
Merge origin/main (PR 457 squashed as 1015c268) into ITL-1244
Nov 19, 2026
cf16fb5
docs(tests): AddTags' name order is neither the new tags' order nor i…
Nov 19, 2026
255ec21
docs: a major bump is needed only when an output name receives anothe…
Nov 19, 2026
b6083f8
Merge origin/main (PRs 449, 451, 458) into ITL-1244
Nov 19, 2026
2f3c8ff
Merge origin/main (PRs 459, 460, 452) into ITL-1244
Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .zed/rules
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,13 @@ Every pipeline element has two parallel hashes:
identity: the default source_id of the in-memory sources
(<source kind>:<algorithm label>:<hex> of the table hash, used when none is given) and the elements of a ListSource. A downstream stream or node hashes its
pod's identity plus its upstreams' content hashes; a function pod's identity is its uri,
not its body. Only a datagram (one row's tags or data) has a content_hash() that is a
not its body. The uri holds the hash of the output schema, a set of named, typed outputs
in no order (developer, November 17, 2026, ITL-1244): reordering output_keys changes it
only when a key's type changes; when a name now receives another value (same-typed keys
reordered without the returned values, or the reverse), what the function computes
changed, like a body edit, and it needs a MAJOR version bump (v0.0 to v1.0: the uri
holds only the major, so a minor bump serves the earlier order's stored values) while
there is no check on a cache hit (ITL-1253); reordering both together changes nothing. The input parameters (names and order) are in no part of the uri. Only a datagram (one row's tags or data) has a content_hash() that is a
digest of its values; that row hash, not the node's content hash, is what results are
memoized by. The node's content hash tells apart, inside a shared table, the rows of
pipelines bound to different sources (__node_content_hash).
Expand Down
8 changes: 7 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,13 @@ Every pipeline element has two parallel hashes:
identity: the default `source_id` of the in-memory sources
(`<source kind>:<algorithm label>:<hex>` of the table hash, used when none is given) and the elements of a `ListSource`. A downstream stream or node hashes its
pod's identity plus its upstreams' content hashes; a function pod's identity is its uri,
not its body. Only a datagram (one row's tags or data) has a `content_hash()` that is a
not its body. The uri holds the hash of the output schema, a set of named, typed outputs
in no order (developer, November 17, 2026, ITL-1244): reordering `output_keys` changes it
only when a key's type changes; when a name now receives another value (same-typed keys
reordered without the returned values, or the reverse), what the function computes
changed, like a body edit, and it needs a MAJOR version bump (`v0.0` to `v1.0`: the uri
holds only the major, so a minor bump serves the earlier order's stored values) while
there is no check on a cache hit (ITL-1253); reordering both together changes nothing. The input parameters (names and order) are in no part of the uri. Only a datagram (one row's tags or data) has a `content_hash()` that is a
digest of its values; that row hash, not the node's content hash, is what results are
memoized by. The node's content hash tells apart, inside a shared table, the rows of
pipelines bound to different sources (`__node_content_hash`).
Expand Down
6 changes: 6 additions & 0 deletions docs/concepts/function-pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,12 @@ print("function calls:", len(calls))
values. To force recomputation after changing what a function does, bump the major
version, e.g. `@function_pod(output_keys="bmi", version="v1.0")` (the default is
`"v0.0"`; a minor bump such as `"v0.1"` is not enough), or rename the function.
The same holds when an output name now receives another value because you reordered
`output_keys` among outputs of the same type without reordering the returned values
(or the reverse): the output schema is a set of named, typed outputs, so its identity
does not change, and only a major version bump makes the function compute the new
values. Reordering both together changes nothing (see *Change detection* in
[Identity & Hashing](identity.md#change-detection)).

!!! note "When the database cannot be read"
A table that does not exist yet reads as empty, and its rows are computed. In a
Expand Down
40 changes: 40 additions & 0 deletions docs/concepts/identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,46 @@ print(step.pod(source).pipeline_hash() == original)
When you change what a function computes, bump its major version (or rename it) so that
stale results are not reused.

The output schema is a set of named, typed outputs: each output key with its type, in no
order, like every other schema. `output_keys` also says which position of the returned
tuple each name takes, and that mapping belongs with the body. So reordering the output keys
changes the identity only when a key's type changes. Swapping two keys of the same type
keeps the identity, as a body edit does. When a name now receives another value (the keys
swapped without the returned values, or the reverse), what the function computes changed:
bump the major version. Until stored results are checked against the current function on a
cache hit (ITL-1253), a run serves the earlier results without a warning. Swapping the keys
and the returned values together changes nothing: each name receives the value it had. The
function's input parameters (their names and their order) are not part of the identity
either.

```python
@function_pod(output_keys=["total", "doubled"])
def pair(age: int) -> tuple[int, int]:
return age + 1, age * 2

original = pair.pod(source).pipeline_hash()

@function_pod(output_keys=["doubled", "total"]) # same types: same identity
def pair(age: int) -> tuple[int, int]:
return age + 1, age * 2

print(pair.pod(source).pipeline_hash() == original)
# True

@function_pod(output_keys=["label", "next_age"])
def describe(age: int) -> tuple[str, int]:
return f"age {age}", age + 1

original = describe.pod(source).pipeline_hash()

@function_pod(output_keys=["next_age", "label"]) # next_age is now a str: new identity
def describe(age: int) -> tuple[str, int]:
return f"age {age}", age + 1

print(describe.pod(source).pipeline_hash() == original)
# False
```

## Order never counts, except where you give it

The rule: no hash, identity, stored value or row depends on the order in which you give
Expand Down
28 changes: 28 additions & 0 deletions docs/dev/design_issues/ITL-1244-OK1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## `src/orcapod/core/data_function.py`

### OK1 — The order of `output_keys` is in no identity
**Status:** resolved (decided: the identity is right as it is; the cache check is ITL-1253)
**Severity:** high
**Issue:** ITL-1244

Two pods of one function whose `output_keys` differ only in order (`['sum', 'product']`
against `['product', 'sum']`) have one uri, content hash and pipeline hash: the uri holds
the hash of the output schema, and a schema hash sorts its field names. A job with the
second order on the database of a job with the first is served the first one's stored rows,
so the values appear under the other names. Found by the several-item test audit
(ITL-1236).

**Fix:** Decided by the developer (November 17, 2026): the outputs of a function are a set of
named, typed values, so the uri holds the order-free output schema, as before. A swap of
differently typed keys changes the schema and so the uri; a swap of same-typed keys does not.
The positional mapping belongs with the body: when a name now receives another value
(same-typed keys swapped without the returned values, or the reverse), what the function
computes changed and needs a major version bump, as a body edit does; swapping both
together changes nothing (the uri holds only the major version, so a minor bump would serve the earlier order's stored values while
a cache hit is not checked, ITL-1253). No code changed. The
behaviour is pinned in `tests/test_core/function_pod/test_output_keys_identity.py` (two and
three keys in every order, sync and async, in memory and in a job on an in-memory and a
Delta database, plain tags and data-tags; input parameters pinned as outside the uri) and
documented in `docs/concepts/identity.md` (*Change detection*). A cache hit whose stored
function variation data differs from the current function is still served silently: that
check is ITL-1253 (a strict xfail test states it).
8 changes: 4 additions & 4 deletions docs/dev/specs/itl-1236-several-item-test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Legend: **yes** (with the best test as evidence), **no** (with what the closest
| `GroupBy` `by`, member order | yes: `ops/test_group_by.py::TestGroupByShape::test_one_row_per_distinct_key` | keys only on `main` | yes | no on `main` | 1 key on `main` |
| ↳ covered by PR #434 (ITL-1226) | | `test_group_by_member_order.py::test_the_order_of_by_is_not_identity` | plain, data-tag, mixed | `test_no_arrangement_of_the_input_changes_the_result` (24 × 4, source and raw stream) | `test_a_job_gives_the_same_rows_sync_and_async_for_any_arrangement` |
| `TagBy` columns | yes: `dt/test_tag_by.py::test_named_data_columns_become_data_tags_in_the_order_given` | yes: `test_the_order_of_the_names_is_part_of_the_identity` (PR #434 reverses this decision) | n/a / yes / refused: `test_an_existing_data_tag_is_refused` | no (1 tag) → NEW `[tag_by/*]` | yes: ASE `tag_by`, `tag_by_reversed` |
| `AddTags` tags | yes: `ops/test_add_tags.py::TestValues::test_arrow_type_of_each_accepted_value_type` | operator hash and keys: `TestIdentity::test_order_is_part_of_the_identity`; stream hashes → NEW `test_add_tags_order_is_the_order_of_the_new_tags_and_its_identity` | yes: `dt/test_add_tags.py` | no → NEW | yes: ASE `add_tags`, `ref_add_tags` |
| `AddTags` tags | yes: `ops/test_add_tags.py::TestValues::test_arrow_type_of_each_accepted_value_type` | operator hash and keys: `TestIdentity::test_order_is_not_part_of_the_identity`; stream hashes → NEW `test_add_tags_order_is_neither_the_order_of_the_new_tags_nor_identity` (ITL-1269 made the order free; it was part of the identity when this audit was written) | yes: `dt/test_add_tags.py` | no → NEW | yes: ASE `add_tags`, `ref_add_tags` |
| `SelectTagColumns` columns | **no** (only one name, or all) → NEW | **no** (`WHF::test_tag_column_spellings_share_identity` uses one name) → NEW | yes: `dt/test_roles.py::test_each_operator_acts_by_role` | no → NEW | yes |
| `DropTagColumns` columns | **no** → NEW | **no** → NEW | yes | no → NEW | yes |
| `SelectDataColumns` columns | yes: ASE `select_data_columns` | hash: `WHF::TestColumnSelectionIdentity`; keys, rows → NEW | yes | no → NEW | yes |
Expand Down Expand Up @@ -84,7 +84,7 @@ Legend: **yes** (with the best test as evidence), **no** (with what the closest
| `CachedSource` | 1 tag | no | **plain only** (data-tag read-back untested) | no | no |
| `DerivedSource(tags_as_data=)` | yes: `sources/test_derived_source_tags_as_data.py::TestColumns::test_several_copies_follow_map_order` | content hash only: `TestIdentity::test_mapping_order_does_not_change_content_hash` | plain; data-tag origin `dt/test_derived_source.py::test_tags_as_data_over_a_data_tag_node` | one arrangement | yes |
| function pod, several inputs | 2: `function_pod/test_function_pod_auto_select.py::test_call_selects_once_after_the_join`; 3: `dt/test_edi_end_to_end.py` | **no**: `pod(b, a)` never compared with `pod(a, b)` | data-tag parameter (EDI) | no | yes |
| `output_keys`, several | yes: `data_function/test_data_function.py::test_multiple_output_keys` | **no**; order is not in the identity: **ITL-1244** | — | — | value only |
| `output_keys`, several | yes: `data_function/test_data_function.py::test_multiple_output_keys` | decided (ITL-1244): the uri holds the order-free output schema; a swap of differently typed keys is another function, of same-typed keys the same (`function_pod/test_output_keys_identity.py`) | — | — | value only |
| automatic select of several extra columns | yes: `test_dropping_logs_one_info_message_naming_the_columns` | no (kept list sorted) | one data-tag falls through | no | yes |
| `PipelineJob.bind(sources=)`, several | yes: `test_pipeline/test_pipeline_job.py::TestPipelineJobBind::test_bind_sources_mutates_job` (membership) | n/a (dict order unused) | plain only | — | — |
| bind a source in another column order | yes: `test_bind_type_check.py::test_columns_match_by_name_within_each_group_whatever_their_order` (plain, run ok only) | yes (plain) | **mixed roles: ITL-1245** (accepted, then the node's table breaks) | partly | async read in `test_bind_narrower_source.py::test_columns_follow_the_declared_order` |
Expand All @@ -97,7 +97,7 @@ Legend: **yes** (with the best test as evidence), **no** (with what the closest
| 1 | `MergeJoin(A, B)` and `MergeJoin(B, A)` give the source-info lists of tied values in argument order | stored source info (operator cache, downstream tables); not the hashes | ITL-1241 |
| 2 | `MapTags` refuses a swap or cycle of data-tags that it accepts for plain tags (`MapData` is right: a data-only move) | error only | ITL-1242 |
| 3 | `MergeJoin` raises `TypeError` on a null in a colliding column | error only | ITL-1243 |
| 4 | Swapping `output_keys` keeps the function's uri, so a job serves stored values under swapped names | result cache: wrong values served | ITL-1244 (rule undecided) |
| 4 | Swapping `output_keys` keeps the function's uri, so a job serves stored values under swapped names | result cache: wrong values served | ITL-1244 (decided: identity right as it is; a same-typed swap that gives a name another value needs a major version bump, swapping the returned values with the keys changes nothing; the cache check is ITL-1253) |
| 5 | Binding a source with mixed tag roles in another column order is accepted, then the source node's `as_table` raises | error on read; the run is right | ITL-1245 |
| 6 | A function pod over data-tags (`FallThroughPod`) hashes its fall-through tags in the input's tag order: two sources that differ only in tag order give the function node another content and pipeline hash | pipeline hash, pipeline table path | ITL-1246 |
| 7 | Input whose table layout differs from its tag order: every unary operator's result keys list the tags in the physical order while its rows use the tag order; Join, SemiJoin, MergeJoin (and, with data-tags, the tag select/drop and `MapTags` forms) give the async rows another column order than the sync rows. In a job, an operator node stores one column order on both orchestrators (measured, tested) | column order only; no hash, no stored table | ITL-1249 |
Expand All @@ -107,7 +107,7 @@ Legend: **yes** (with the best test as evidence), **no** (with what the closest

Order- or role-dependent behaviour that reaches a hash or a stored table first.

1. `output_keys` order: not in identity, stored values served under swapped names (ITL-1244).
1. `output_keys` order: decided in ITL-1244 (order-free output schema; a same-typed swap that gives a name another value needs a major version bump; keys and returned values swapped together change nothing); the missing check on a cache hit is ITL-1253.
2. `MergeJoin` tied values: source-info order follows the inputs (ITL-1241).
3. `PolarsFilter` predicate order in identity, constraint order not; never tested with two (ITL-1247).
4. `record_id_columns` key order: moves record ids, tokens and the content hash; never compared.
Expand Down
7 changes: 4 additions & 3 deletions docs/tutorial/06-reruns-and-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ No call, and the **old** values. There is no error and no warning.

!!! warning "Editing a function's code does not recompute its results"
Orcapod does not look at a function's source code. It identifies a function by three
things: its **name**, its **output** (the `output_keys` and return type), and its
**major version**. As long as those are the same, stored results are reused, whatever
the body now says.
things: its **name**, its **output** (each output name with its type, in any order),
and its **major version**. As long as those are the same, stored results are reused,
whatever the body now says, and whichever position of the returned tuple each output
name takes.

## Bump the major version

Expand Down
Loading
Loading