Skip to content

Commit 5cd12ac

Browse files
authored
Clarify some types. (#438)
1 parent 802b44e commit 5cd12ac

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

docs/source/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
5454
- {pull}`433` fixes the ids generated for {class}`~pytask.PythonNode`s.
5555
- {pull}`437` fixes the detection of task functions and publishes
5656
{func}`pytask.is_task_function`.
57+
- {pull}`438` clarifies some types.
5758

5859
## 0.3.2 - 2023-06-07
5960

src/_pytask/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def pytask_collect_task_protocol(
220220

221221
@hookimpl(trylast=True)
222222
def pytask_collect_task(
223-
session: Session, path: Path, name: str, obj: Any
223+
session: Session, path: Path | None, name: str, obj: Any
224224
) -> PTask | None:
225225
"""Collect a task which is a function.
226226

src/_pytask/collect_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def produces(objects: PyTree[Any]) -> PyTree[Any]:
7474

7575
def parse_nodes( # noqa: PLR0913
7676
session: Session,
77-
task_path: Path,
77+
task_path: Path | None,
7878
task_name: str,
7979
node_path: Path,
8080
obj: Any,
@@ -241,7 +241,7 @@ def _merge_dictionaries(list_of_dicts: list[dict[Any, Any]]) -> dict[Any, Any]:
241241

242242

243243
def parse_dependencies_from_task_function(
244-
session: Session, task_path: Path, task_name: str, node_path: Path, obj: Any
244+
session: Session, task_path: Path | None, task_name: str, node_path: Path, obj: Any
245245
) -> dict[str, Any]:
246246
"""Parse dependencies from task function."""
247247
has_depends_on_decorator = False
@@ -373,7 +373,7 @@ def _find_args_with_node_annotation(func: Callable[..., Any]) -> dict[str, PNode
373373

374374

375375
def parse_products_from_task_function(
376-
session: Session, task_path: Path, task_name: str, node_path: Path, obj: Any
376+
session: Session, task_path: Path | None, task_name: str, node_path: Path, obj: Any
377377
) -> dict[str, Any]:
378378
"""Parse products from task function.
379379

src/_pytask/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ class NodeInfo(NamedTuple):
3434
arg_name: str
3535
path: tuple[str | int, ...]
3636
value: Any
37-
task_path: Path
37+
task_path: Path | None
3838
task_name: str

0 commit comments

Comments
 (0)