-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsize_dispatch_truncate.json
More file actions
94 lines (94 loc) · 2.16 KB
/
Copy pathsize_dispatch_truncate.json
File metadata and controls
94 lines (94 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
"name": "transform_size → dispatch → truncate (common↔item interaction)",
"config": {
"_PINEAPPLE_VERSION": "0.10.12",
"pipeline_config": {
"operators": {
"count_items": {
"type_name": "transform_size",
"$metadata": {
"common_input": [],
"common_output": ["item_count"],
"item_input": [],
"item_output": []
}
},
"dispatch_count": {
"type_name": "transform_dispatch",
"$metadata": {
"common_input": ["item_count"],
"common_output": [],
"item_input": [],
"item_output": ["total"]
}
},
"keep_top3": {
"type_name": "filter_truncate",
"top_n": 3,
"$metadata": {
"common_input": [],
"common_output": [],
"item_input": [],
"item_output": []
}
}
},
"pipeline_map": {
"main_stage": {
"pipeline": ["count_items", "dispatch_count", "keep_top3"]
}
}
},
"pipeline_group": {
"main": {
"pipeline": ["main_stage"]
}
},
"flow_contract": {
"common_input": [],
"item_input": ["id"],
"common_output": ["item_count"],
"item_output": ["id", "total"]
}
},
"cases": [
{
"name": "5 items → count=5 dispatched → truncate to 3",
"request": {
"common": {},
"items": [
{"id": "a"},
{"id": "b"},
{"id": "c"},
{"id": "d"},
{"id": "e"}
]
},
"expected": {
"common": {"item_count": 5},
"items": [
{"id": "a", "total": 5},
{"id": "b", "total": 5},
{"id": "c", "total": 5}
]
}
},
{
"name": "2 items → count=2, no truncation (top_n=3)",
"request": {
"common": {},
"items": [
{"id": "x"},
{"id": "y"}
]
},
"expected": {
"common": {"item_count": 2},
"items": [
{"id": "x", "total": 2},
{"id": "y", "total": 2}
]
}
}
]
}