Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions changelog.d/ITL-1343.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- The declared meaning of `executor_type` names the stored values `local`, `ray.v0`, and `none`.
2 changes: 1 addition & 1 deletion docs/reference/data-function-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ and these about how it was computed (`__pf_exec_` prefix):

| Column | Python type | Arrow type | Nullable | Meaning |
|---|---|---|---|---|
| `executor_type` | `str` | `large_string` | yes | the executor that ran the function (`local`, `ray`, `none`) |
| `executor_type` | `str` | `large_string` | yes | the executor that ran the function (`local`, `ray.v0`, `none`) |
| `executor_info` | `dict[str, str]` | `large_list<item: struct<key: large_string, value: large_string>>` | yes | the executor's own settings, as text |
| `python_version` | `str` | `large_string` | yes | the Python version that ran the function (`3.12.3`) |
| `extra_info` | `dict[str, str]` | `large_list<item: struct<key: large_string, value: large_string>>` | yes | further facts about the run, as text; empty today |
Expand Down
2 changes: 1 addition & 1 deletion src/orcapod/core/data_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def function_content_hash(
str,
_TEXT,
True,
"the executor that ran the function (local, ray, none)",
"the executor that ran the function (local, ray.v0, none)",
),
StoredColumn(
"executor_info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"execution": [
{
"arrow_type": "large_string",
"meaning": "the executor that ran the function (local, ray, none)",
"meaning": "the executor that ran the function (local, ray.v0, none)",
"name": "executor_type",
"nullable": true,
"python_type": "str"
Expand Down
14 changes: 14 additions & 0 deletions tests/test_data_function_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
declaration_for,
)
from orcapod.core.datagrams import Data
from orcapod.core.executors import LocalPythonFunctionExecutor
from orcapod.core.executors.ray import RayExecutor
from orcapod.core.function_pod import FunctionPod
from orcapod.core.data_function_types import snapshot_path
from orcapod.core.result_cache import COMMON_RESULT_COLUMNS
Expand Down Expand Up @@ -148,6 +150,18 @@ def test_the_python_function_type_is_v1_rev1() -> None:
declaration_for("python.function.v0")


def test_the_declared_executor_type_meaning_lists_the_stored_values() -> None:
column = next(c for c in PYTHON_FUNCTION.execution if c.name == "executor_type")
declared_values = column.meaning.split("(", 1)[1].removesuffix(")").split(", ")
# Reading the identifier does not require initializing a Ray executor.
ray_executor = RayExecutor.__new__(RayExecutor)
assert set(declared_values) == {
LocalPythonFunctionExecutor().executor_type_id,
ray_executor.executor_type_id,
"none",
}


@pytest.mark.parametrize("name", list(FUNCTIONS))
def test_the_data_function_reports_exactly_the_declared_columns(name: str) -> None:
fn, keys = FUNCTIONS[name]
Expand Down
Loading