Skip to content

Commit 0a767f1

Browse files
tobiasraabeOstheer
andauthored
Fix type hints for Task.execute() and TaskWithoutPath.execute(). (#548)
Co-authored-by: Mathijs Verhaegh <[email protected]>
1 parent c7f3da8 commit 0a767f1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/source/changes.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask).
77

8+
## 0.4.6
9+
10+
- {pull}`548` fixes the type hints for {meth}`~pytask.Task.execute` and
11+
{meth}`~pytask.TaskWithoutPath.execute`. Thanks to {user}`Ostheer`.
12+
813
## 0.4.5 - 2024-01-09
914

1015
- {pull}`515` enables tests with graphviz in CI. Thanks to {user}`NickCrews`.

src/_pytask/nodes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def state(self) -> str | None:
8080
else:
8181
return hashlib.sha256(source.encode()).hexdigest()
8282

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

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

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

0 commit comments

Comments
 (0)