From 3010d42067d5c47ab232c30397b284814f64f46c Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 11 Jan 2024 14:15:48 +0100 Subject: [PATCH 1/2] Fix type hints for PTask.execute(). --- src/_pytask/nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytask/nodes.py b/src/_pytask/nodes.py index 537b1125..c62bfa5e 100644 --- a/src/_pytask/nodes.py +++ b/src/_pytask/nodes.py @@ -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) From cfeb91d232a2eca02d8201960eed0d1362538679 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 11 Jan 2024 15:47:03 +0000 Subject: [PATCH 2/2] Add to changes. Co-authored-by: Mathijs Verhaegh <5295054+Ostheer@users.noreply.github.com> --- docs/source/changes.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/source/changes.md b/docs/source/changes.md index 0556fdc2..ebea8973 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -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`.