Skip to content
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

Fix type hints for Task.execute() and TaskWithoutPath.execute(). #548

Merged
merged 2 commits into from
Jan 11, 2024
Merged
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
5 changes: 5 additions & 0 deletions docs/source/changes.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,11 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
releases are available on [PyPI](https://pypi.org/project/pytask) and
[Anaconda.org](https://anaconda.org/conda-forge/pytask).

## 0.4.6

- {pull}`548` fixes the type hints for {meth}`~pytask.Task.execute` and
{meth}`~pytask.TaskWithoutPath.execute`. Thanks to {user}`Ostheer`.

## 0.4.5 - 2024-01-09

- {pull}`515` enables tests with graphviz in CI. Thanks to {user}`NickCrews`.
4 changes: 2 additions & 2 deletions src/_pytask/nodes.py
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ def state(self) -> str | None:
else:
return hashlib.sha256(source.encode()).hexdigest()

def execute(self, **kwargs: Any) -> None:
def execute(self, **kwargs: Any) -> Any:
"""Execute the task."""
return self.function(**kwargs)

@@ -140,7 +140,7 @@ def state(self) -> str | None:
return hash_path(self.path, modification_time)
return None

def execute(self, **kwargs: Any) -> None:
def execute(self, **kwargs: Any) -> Any:
"""Execute the task."""
return self.function(**kwargs)