-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathpipeline-spec.yaml
95 lines (89 loc) · 2.17 KB
/
pipeline-spec.yaml
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
raise-exception:
pipeline:
- run: raise_exception
code: raise Exception()
failure-no-errors:
pipeline:
- run: success
code: ""
success:
pipeline:
- run: success
code: |
from datapackage_pipelines.wrapper import ingest, spew
parameters, datapackage, resources = ingest()
spew(datapackage, [])
verbose-logs-with-sleep:
pipeline:
- run: code
code: |
from datapackage_pipelines.wrapper import ingest, spew
import logging, itertools, time
log_numbers = itertools.count()
def log_line():
logging.info('log line {}'.format(next(log_numbers)))
log_line()
time.sleep(.1)
log_line()
time.sleep(.1)
log_line()
time.sleep(.1)
parameters, datapackage, resources = ingest()
log_line()
time.sleep(.1)
log_line()
time.sleep(.1)
log_line()
time.sleep(.1)
spew(datapackage, [])
log_line()
time.sleep(.1)
log_line()
time.sleep(.1)
log_line()
load-resource-progress-log:
pipeline:
- run: load_resource
parameters:
url: ../data/datapackage.json
resource: my-spiffy-resource
log-progress-rows: 2
custom-formatters:
pipeline:
- run: load_resource
parameters:
url: ../data/datapackage.json
resource: my-spiffy-resource
- run: duplicate
parameters:
source: my-spiffy-resource
target-name: my-spiffy-xlsx-resource
target-path: my-spiffy-resource.xlsx
- run: dump.to_path
parameters:
out-path: custom_formatters
force-format: false
counters:
resource-hash: ''
file-formatters:
xlsx: custom_formatters.xlsx_format.XLSXFormat
- run: dump.to_zip
parameters:
out-file: custom_formatters/datapackage.zip
force-format: false
counters:
resource-hash: ''
file-formatters:
xlsx: custom_formatters.xlsx_format.XLSXFormat
dataflows:
pipeline:
- run: load_resource
parameters:
url: ../data/datapackage.json
resource: my-spiffy-resource
- flow: test_flow
parameters:
attr: foo
- run: dump_to_path
parameters:
out-path: test_flow_data