File tree Expand file tree Collapse file tree 2 files changed +10
-23
lines changed Expand file tree Collapse file tree 2 files changed +10
-23
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
14
14
caused flaky tests.
15
15
- {pull}` 486 ` adds default names to {class}` ~pytask.PPathNode ` .
16
16
- {pull}` 488 ` raises an error when an invalid value is used in a return annotation.
17
- - {pull}` 489 ` simplifies parsing products and does not raise an error when a product
18
- annotation is used with the argument name ` produces ` . And, allow ` produces ` to intake
19
- any node.
17
+ - {pull}` 489 ` and {pull} ` 491 ` simplifies parsing products and does not raise an error
18
+ when a product annotation is used with the argument name ` produces ` . And, allow
19
+ ` produces ` to intake any node.
20
20
- {pull}` 490 ` refactors and better tests parsing of dependencies.
21
21
22
22
## 0.4.2 - 2023-11-8
Original file line number Diff line number Diff line change @@ -406,10 +406,16 @@ def parse_products_from_task_function( # noqa: C901
406
406
if set (parameters_with_product_annot ) - {"produces" }:
407
407
has_produces_argument = True
408
408
409
+ if "return" in parameters_with_node_annot :
410
+ parameters_with_product_annot .append ("return" )
411
+ has_return = True
412
+
409
413
if parameters_with_product_annot :
410
414
out = {}
411
415
for parameter_name in parameters_with_product_annot :
412
- has_annotation = True
416
+ if parameter_name != "return" :
417
+ has_annotation = True
418
+
413
419
if (
414
420
parameter_name not in kwargs
415
421
and parameter_name not in parameters_with_node_annot
@@ -448,25 +454,6 @@ def parse_products_from_task_function( # noqa: C901
448
454
)
449
455
out [parameter_name ] = collected_products
450
456
451
- if "return" in parameters_with_node_annot :
452
- has_return = True
453
- collected_products = tree_map_with_path (
454
- lambda p , x : _collect_product (
455
- session ,
456
- node_path ,
457
- task_name ,
458
- NodeInfo (
459
- arg_name = "return" ,
460
- path = p ,
461
- value = x ,
462
- task_path = task_path ,
463
- task_name = task_name ,
464
- ),
465
- ),
466
- parameters_with_node_annot ["return" ],
467
- )
468
- out = {"return" : collected_products }
469
-
470
457
task_produces = obj .pytask_meta .produces if hasattr (obj , "pytask_meta" ) else None
471
458
if task_produces :
472
459
has_task_decorator = True
You can’t perform that action at this time.
0 commit comments