Skip to content

Fix PythonNode examples in docs. #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2024
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
1 change: 1 addition & 0 deletions docs/source/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading