File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -453,6 +453,12 @@ def process_advanced_block(
453
453
if block .trace_error_on_retry :
454
454
scope = set_error_to_scope_for_retry (scope , error , block .pdl__id )
455
455
continue
456
+ state = init_state .with_yield_result (
457
+ init_state .yield_result and ContributeTarget .RESULT in block .contribute
458
+ )
459
+ state = state .with_yield_background (
460
+ state .yield_background and context_in_contribute (block )
461
+ )
456
462
(
457
463
result ,
458
464
background ,
Original file line number Diff line number Diff line change @@ -76,3 +76,15 @@ def test_type_checking_in_fallback():
76
76
str (exc .value .message )
77
77
== "Type errors during spec checking:\n line 4 - Error should be of type <class 'int'>"
78
78
)
79
+
80
+
81
+ def test_fallback_and_parser ():
82
+ prog_str = """
83
+ model: "raise an error"
84
+ parser: json
85
+ spec: { xxx: string, age: integer}
86
+ fallback:
87
+ data: { "xxx": "rosa", "age": 3 }
88
+ """
89
+ result = exec_str (prog_str )
90
+ assert result == {"xxx" : "rosa" , "age" : 3 }
You can’t perform that action at this time.
0 commit comments