Skip to content

Commit 2756d47

Browse files
authored
Fix PythonNode examples in docs. (#604)
1 parent 0afe7e8 commit 2756d47

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/source/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
4545
- {pull}`599` adds a test fixture for switching the cwd.
4646
- {pull}`600` refactors test using subprocesses.
4747
- {pull}`603` fixes an example in the documentation about capturing warnings.
48+
- {pull}`604` fixes some examples with `PythonNode`s in the documentation.
4849

4950
## 0.4.7 - 2024-03-19
5051

docs_src/how_to_guides/hashing_inputs_of_tasks_example_2_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def task_example(
9-
text: Annotated[str, PythonNode("Hello, World", hash=True)],
9+
text: Annotated[str, PythonNode(value="Hello, World", hash=True)],
1010
path: Annotated[Path, Product] = Path("file.txt"),
1111
) -> None:
1212
path.write_text(text)

docs_src/how_to_guides/hashing_inputs_of_tasks_example_3_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def calculate_hash(x: Any) -> str:
1212
return DeepHash(x)[x]
1313

1414

15-
node = PythonNode({"a": 1, "b": 2}, hash=calculate_hash)
15+
node = PythonNode(value={"a": 1, "b": 2}, hash=calculate_hash)
1616

1717

1818
def task_example(

0 commit comments

Comments
 (0)