-
Notifications
You must be signed in to change notification settings - Fork 5
/
hello_world_multiple_cases.yml
95 lines (84 loc) · 2.78 KB
/
hello_world_multiple_cases.yml
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
95
---
version: '0.1'
description: |
MultipleCases - Multiple cases require creating identifiers and associating them
with sources and targets.
identifiers:
- identifier: students
attributes:
- field: id
generator: unique_integer
sources:
- source: raw_students
identifier_map:
- column: id
identifier:
name: students
attribute: id
targets:
- target: salutations
identifier_map:
- column: id
identifier:
name: students
attribute: id
factories:
- factory: SomeStudents
description: Minimal example of what some student records may look like
data:
- source: raw_students
table: |
| id | name |
| - | - |
| 1 | Buffy |
| 2 | Willow |
# Use values to populate a constant over all records
values:
- column: clique
value: Scooby Gang
scenarios:
- scenario: Hello World With Multiple Cases
description: The simplest scenario
factory:
parents:
- SomeStudents
cases:
- case: HelloGang
description: Make sure we say hello to everyone
expected:
data:
- target: salutations
table: |
| id | name | clique | salutation |
| - | - | - | - |
| 1 | Buffy | Scooby Gang | Hello Buffy |
| 2 | Willow | Scooby Gang | Hello Willow |
- case: GoodbyeVillians
description: Say goodbye to villians
# For this case, we tweak the factory defined for the scenario.
factory:
# The ids here might be the same as above. However, these are just named
# references and get translated into unique ids when the source data
# is generated.
data:
- source: raw_students
table: |
| id | name |
| - | - |
| 1 | Drusilla |
| 2 | Harmony |
# Use values to populate a constant over all records
values:
- column: clique
value: Vampires
expected:
data:
# Again, the ids here are not the actual ids sent to dtspec after performing
# the transformations. They are just named references and dtspec
# keeps track of the relationship between the actual ids and the named ones.
- target: salutations
table: |
| id | name | clique | salutation |
| - | - | - | - |
| 1 | Drusilla | Vampires | Goodbye Drusilla |
| 2 | Harmony | Vampires | Goodbye Harmony |