diff --git a/docs/source/changes.md b/docs/source/changes.md index 6cb637f9..6709a544 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -45,6 +45,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and - {pull}`599` adds a test fixture for switching the cwd. - {pull}`600` refactors test using subprocesses. - {pull}`603` fixes an example in the documentation about capturing warnings. +- {pull}`604` fixes some examples with `PythonNode`s in the documentation. ## 0.4.7 - 2024-03-19 diff --git a/docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py b/docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py index 97566726..ad14046e 100644 --- a/docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py +++ b/docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py @@ -6,7 +6,7 @@ def task_example( - text: Annotated[str, PythonNode("Hello, World", hash=True)], + text: Annotated[str, PythonNode(value="Hello, World", hash=True)], path: Annotated[Path, Product] = Path("file.txt"), ) -> None: path.write_text(text) diff --git a/docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py b/docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py index 56c5cb1b..ab97bacd 100644 --- a/docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py +++ b/docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py @@ -12,7 +12,7 @@ def calculate_hash(x: Any) -> str: return DeepHash(x)[x] -node = PythonNode({"a": 1, "b": 2}, hash=calculate_hash) +node = PythonNode(value={"a": 1, "b": 2}, hash=calculate_hash) def task_example(