From 6adf1f39b105fd8225bcf89c5be380776e0ffcbb Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Tue, 23 Apr 2024 23:47:08 +0200 Subject: [PATCH 1/2] Fix PythonNode examples in docs. --- .../how_to_guides/hashing_inputs_of_tasks_example_2_py310.py | 2 +- .../how_to_guides/hashing_inputs_of_tasks_example_3_py310.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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( From 69dc25aaa5f595a5e08b8c3a5c363584d1ed9650 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Tue, 23 Apr 2024 23:48:20 +0200 Subject: [PATCH 2/2] to changes. --- docs/source/changes.md | 1 + 1 file changed, 1 insertion(+) 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