diff --git a/changelog.d/ITL-1343.md b/changelog.d/ITL-1343.md new file mode 100644 index 000000000..3dacceb65 --- /dev/null +++ b/changelog.d/ITL-1343.md @@ -0,0 +1,3 @@ +### Fixed + +- The declared meaning of `executor_type` names the stored values `local`, `ray.v0`, and `none`. diff --git a/docs/reference/data-function-types.md b/docs/reference/data-function-types.md index 35b81a9ad..989402ce1 100644 --- a/docs/reference/data-function-types.md +++ b/docs/reference/data-function-types.md @@ -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>` | 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>` | yes | further facts about the run, as text; empty today | diff --git a/src/orcapod/core/data_function.py b/src/orcapod/core/data_function.py index acf8e48ac..c88e74337 100644 --- a/src/orcapod/core/data_function.py +++ b/src/orcapod/core/data_function.py @@ -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", diff --git a/src/orcapod/data_function_types/python.function/v1-rev1.json b/src/orcapod/data_function_types/python.function/v1-rev1.json index 9d973d711..227f2c472 100644 --- a/src/orcapod/data_function_types/python.function/v1-rev1.json +++ b/src/orcapod/data_function_types/python.function/v1-rev1.json @@ -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" diff --git a/tests/test_data_function_types.py b/tests/test_data_function_types.py index cf9f4cb59..418c4f353 100644 --- a/tests/test_data_function_types.py +++ b/tests/test_data_function_types.py @@ -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 @@ -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]