diff --git a/changelog.d/ITL-1253.md b/changelog.d/ITL-1253.md new file mode 100644 index 000000000..9bb4a211d --- /dev/null +++ b/changelog.d/ITL-1253.md @@ -0,0 +1,3 @@ +### Added + +- Python function result records include `__pf_var_output_keys`, the output names in declared order (ITL-1253). Older result rows read with null in this column. Cache reuse still matches the function identity and input data hash. diff --git a/docs/concepts/pipeline-job.md b/docs/concepts/pipeline-job.md index 25871086b..ba75f30c9 100644 --- a/docs/concepts/pipeline-job.md +++ b/docs/concepts/pipeline-job.md @@ -266,7 +266,7 @@ reads SpiralDB only. The full list, type by type, is [Data types per database](../reference/database-types.md). Orcapod's own stored tables hold such columns. A function node's result table holds -list-valued executor columns and `__`-prefixed columns. A side-effect node's log holds a UTC +list-valued columns for the declared output names and executor details. A side-effect node's log holds a UTC timestamp and `__data_context`. An operator cache holds `__data_context`, the row's entry id and a UTC timestamp, the time the row was first stored (`__recorded_at`). A cached source holds `__data_context` too. So a job refuses these nodes when it is built, or when a database @@ -299,7 +299,7 @@ try: compute_bmi.pod(mice(cohort_a), label="bmi") except UnstorableColumnError as exc: print(exc) -# node 'bmi': a SQLiteConnector database cannot store column '__pf_exec_executor_info' of Arrow type large_list<...>: SQLite has no column type for it. Use an InMemoryArrowDatabase instead; docs/reference/database-types.md lists what each database keeps. +# node 'bmi': a SQLiteConnector database cannot store column '__pf_var_output_keys' of Arrow type large_list<...>: SQLite has no column type for it. Use an InMemoryArrowDatabase instead; docs/reference/database-types.md lists what each database keeps. ``` ## What a re-run computes diff --git a/docs/dev/design_issues/ITL-1244-OK1.md b/docs/dev/design_issues/ITL-1244-OK1.md index fb628dc14..c5fc883ae 100644 --- a/docs/dev/design_issues/ITL-1244-OK1.md +++ b/docs/dev/design_issues/ITL-1244-OK1.md @@ -23,6 +23,6 @@ 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). +documented in `docs/concepts/identity.md` (*Change detection*). ITL-1253 records the declared +output order in the function record for a future opt-in check. The test suite pins silent +reuse as the default. diff --git a/docs/reference/data-function-types.md b/docs/reference/data-function-types.md index 815dc5e11..d4f44f041 100644 --- a/docs/reference/data-function-types.md +++ b/docs/reference/data-function-types.md @@ -119,6 +119,7 @@ Each result row holds these columns about the function (`__pf_var_` prefix): | `function_signature_hash` | `bytes` | `large_binary` | yes | the hash of the function's declared interface | | `function_content_hash` | `bytes \| None` | `large_binary` | yes | the hash of the function as written (a lambda: its enclosing lines); absent when its source cannot be read (a plain REPL, `python -c`, `exec`) or, for a function other than a lambda, does not start at a `def` statement | | `git_hash` | `str` | `large_string` | yes | the git commit of the function's file or working directory, with `-dirty`, `-untracked` and `-` suffixes; `unknown` outside git | +| `output_keys` | `list[str] \| None` | `large_list` | yes | the output names in declared order on every new row. Null means the row predates this column. Nothing compares this column today | and these about how it was computed (`__pf_exec_` prefix): @@ -138,6 +139,9 @@ The two hashes, each stored as `