@platforma-sdk/workflow-tengo 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tengo/lib/exec.internal.lib.tengo +1 -1
- package/dist/tengo/lib/exec.lib.tengo +56 -0
- package/dist/tengo/lib/exec.runenv.lib.tengo +57 -0
- package/dist/tengo/lib/pframes.xsv.lib.tengo +20 -11
- package/dist/tengo/lib/render.lib.tengo +2 -1
- package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.aggregate.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.import-xsv-map.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
- package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
- package/package.json +3 -3
|
@@ -179,6 +179,7 @@ builder := func() {
|
|
|
179
179
|
},
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
+
* @deprecated, use cacheMillis, cacheSeconds, cacheMinutes, cacheHours and cacheDays instead.
|
|
182
183
|
* Sets the cache time.
|
|
183
184
|
*
|
|
184
185
|
* @param time: duration - the cache time from 'times' library.
|
|
@@ -192,6 +193,61 @@ builder := func() {
|
|
|
192
193
|
return self
|
|
193
194
|
},
|
|
194
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Sets the cache time in milliseconds.
|
|
198
|
+
*
|
|
199
|
+
* @param millis: number
|
|
200
|
+
*/
|
|
201
|
+
cacheMillis: func(millis) {
|
|
202
|
+
ll.assert(is_int(millis) && millis > 0, "cache time must be a number of milliseconds")
|
|
203
|
+
cache = millis * times.millisecond
|
|
204
|
+
return self
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Sets the cache time in seconds.
|
|
209
|
+
*
|
|
210
|
+
* @param seconds: number
|
|
211
|
+
*/
|
|
212
|
+
cacheSeconds: func(seconds) {
|
|
213
|
+
ll.assert(is_int(seconds) && seconds > 0, "cache time must be a number of seconds")
|
|
214
|
+
cache = seconds * times.second
|
|
215
|
+
return self
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Sets the cache time in minutes.
|
|
220
|
+
*
|
|
221
|
+
* @param minutes: number
|
|
222
|
+
*/
|
|
223
|
+
cacheMinutes: func(minutes) {
|
|
224
|
+
ll.assert(is_int(minutes) && minutes > 0, "cache time must be a number of minutes")
|
|
225
|
+
cache = minutes * times.minute
|
|
226
|
+
return self
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Sets the cache time in hours.
|
|
231
|
+
*
|
|
232
|
+
* @param hours: number
|
|
233
|
+
*/
|
|
234
|
+
cacheHours: func(hours) {
|
|
235
|
+
ll.assert(is_int(hours) && hours > 0, "cache time must be a number of hours")
|
|
236
|
+
cache = hours * times.hour
|
|
237
|
+
return self
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Sets the cache time in days
|
|
242
|
+
*
|
|
243
|
+
* @param days: number
|
|
244
|
+
*/
|
|
245
|
+
cacheDays: func(days) {
|
|
246
|
+
ll.assert(is_int(days) && days > 0, "cache time must be a number of days")
|
|
247
|
+
cache = days * times.hour * 24
|
|
248
|
+
return self
|
|
249
|
+
},
|
|
250
|
+
|
|
195
251
|
/**
|
|
196
252
|
* Sets the number of error lines to be captured.
|
|
197
253
|
*
|
|
@@ -10,6 +10,7 @@ validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
|
10
10
|
pkg := import("@platforma-sdk/workflow-tengo:exec.package")
|
|
11
11
|
assets := import("@platforma-sdk/workflow-tengo:assets")
|
|
12
12
|
render := import("@platforma-sdk/workflow-tengo:render")
|
|
13
|
+
times := import("times")
|
|
13
14
|
|
|
14
15
|
_RTYPE_SAVE_RUN_ENV := { Name: "SaveRunEnv/executor", Version: "1" }
|
|
15
16
|
_INPUT_SETTINGS := "settings"
|
|
@@ -167,6 +168,62 @@ pythonVenv := func() {
|
|
|
167
168
|
},
|
|
168
169
|
|
|
169
170
|
/**
|
|
171
|
+
* Sets the cache time in milliseconds.
|
|
172
|
+
*
|
|
173
|
+
* @param millis: number
|
|
174
|
+
*/
|
|
175
|
+
cacheMillis: func(millis) {
|
|
176
|
+
ll.assert(is_int(millis) && millis > 0, "cache time must be a number of milliseconds")
|
|
177
|
+
cache = millis * times.millisecond
|
|
178
|
+
return self
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Sets the cache time in seconds.
|
|
183
|
+
*
|
|
184
|
+
* @param seconds: number
|
|
185
|
+
*/
|
|
186
|
+
cacheSeconds: func(seconds) {
|
|
187
|
+
ll.assert(is_int(seconds) && seconds > 0, "cache time must be a number of seconds")
|
|
188
|
+
cache = seconds * times.second
|
|
189
|
+
return self
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Sets the cache time in minutes.
|
|
194
|
+
*
|
|
195
|
+
* @param minutes: number
|
|
196
|
+
*/
|
|
197
|
+
cacheMinutes: func(minutes) {
|
|
198
|
+
ll.assert(is_int(minutes) && minutes > 0, "cache time must be a number of minutes")
|
|
199
|
+
cache = minutes * times.minute
|
|
200
|
+
return self
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Sets the cache time in hours.
|
|
205
|
+
*
|
|
206
|
+
* @param hours: number
|
|
207
|
+
*/
|
|
208
|
+
cacheHours: func(hours) {
|
|
209
|
+
ll.assert(is_int(hours) && hours > 0, "cache time must be a number of hours")
|
|
210
|
+
cache = hours * times.hour
|
|
211
|
+
return self
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Sets the cache time in days
|
|
216
|
+
*
|
|
217
|
+
* @param days: number
|
|
218
|
+
*/
|
|
219
|
+
cacheDays: func(days) {
|
|
220
|
+
ll.assert(is_int(days) && days > 0, "cache time must be a number of days")
|
|
221
|
+
cache = days * times.hour * 24
|
|
222
|
+
return self
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @deprecated, use cacheMillis, cacheSeconds, cacheMinutes, cacheHours and cacheDays instead.
|
|
170
227
|
* Sets the cache time.
|
|
171
228
|
*
|
|
172
229
|
* @param time: duration - the cache time from 'times' library.
|
|
@@ -64,8 +64,10 @@ getColumnSpec := func(axesSpec, col) {
|
|
|
64
64
|
* @param ops: object - additional options
|
|
65
65
|
* {
|
|
66
66
|
* dataOnly: boolean - set to true to completely skip creation of specs
|
|
67
|
+
* splitDataAndSpec: boolean - if true, resulting map will have nested structures,
|
|
68
|
+
* with "spec" + "data" fields in nested maps
|
|
67
69
|
* transpose: object - if specified, then the input table will be transposed
|
|
68
|
-
* {
|
|
70
|
+
* {
|
|
69
71
|
* separator: string - (optional) use separator instead of inferring from the file extension
|
|
70
72
|
* pAxisIdx: index - (optional) the index of the primary axis (column in the input xsv); default 0
|
|
71
73
|
* pAxisName: string - (optional) the name of the primary axis (column name in the input xsv); default undefined
|
|
@@ -86,7 +88,7 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
86
88
|
|
|
87
89
|
xsvFileName := "file." + xsvType
|
|
88
90
|
|
|
89
|
-
ops := renderOps({ dataOnly: false }, ops...)
|
|
91
|
+
ops := renderOps({ dataOnly: false, splitDataAndSpec: false }, ops...)
|
|
90
92
|
|
|
91
93
|
if ops.transpose != undefined {
|
|
92
94
|
|
|
@@ -99,7 +101,7 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
99
101
|
software(transposeXsvSw).
|
|
100
102
|
printErrStreamToStdout().
|
|
101
103
|
inLightQueue()
|
|
102
|
-
|
|
104
|
+
|
|
103
105
|
if (tops.separator != undefined) {
|
|
104
106
|
transposeXsv = transposeXsv.arg("-input-separator").arg(tops.separator)
|
|
105
107
|
}
|
|
@@ -119,15 +121,15 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
119
121
|
transposeXsv = transposeXsv.arg("-metric-columns-search").arg(tops.sAxisSearch)
|
|
120
122
|
}
|
|
121
123
|
if (tops.sAxisName != undefined) {
|
|
122
|
-
transposeXsv = transposeXsv.arg("-metric-label").arg(tops.sAxisName)
|
|
124
|
+
transposeXsv = transposeXsv.arg("-metric-label").arg(tops.sAxisName)
|
|
123
125
|
}
|
|
124
126
|
if (tops.valueName != undefined) {
|
|
125
|
-
transposeXsv = transposeXsv.arg("-value-label").arg(tops.valueName)
|
|
127
|
+
transposeXsv = transposeXsv.arg("-value-label").arg(tops.valueName)
|
|
126
128
|
}
|
|
127
129
|
if (tops.separatorOverride != undefined) {
|
|
128
|
-
transposeXsv = transposeXsv.arg("-separator").arg(tops.separatorOverride)
|
|
130
|
+
transposeXsv = transposeXsv.arg("-separator").arg(tops.separatorOverride)
|
|
129
131
|
}
|
|
130
|
-
|
|
132
|
+
|
|
131
133
|
transposeXsv = transposeXsv.
|
|
132
134
|
arg(xsvFileName).
|
|
133
135
|
arg(transposedFileName).
|
|
@@ -170,8 +172,15 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
170
172
|
for col in spec.columns {
|
|
171
173
|
id := util.xsvColumnId(col)
|
|
172
174
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
if ops.splitDataAndSpec {
|
|
176
|
+
result[id] = {
|
|
177
|
+
data: pf.getFutureInputField(id),
|
|
178
|
+
spec: getColumnSpec(axesSpec, col)
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
result[id + ".data"] = pf.getFutureInputField(id)
|
|
182
|
+
result[id + ".spec"] = getColumnSpec(axesSpec, col)
|
|
183
|
+
}
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
return result
|
|
@@ -192,7 +201,7 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
192
201
|
* additionalAxesSpec: AxisSpec[] - array of additional axes spec to prepend to
|
|
193
202
|
* each column spec
|
|
194
203
|
* transpose: object - if specified, then the input table will be transposed
|
|
195
|
-
* {
|
|
204
|
+
* {
|
|
196
205
|
* separator: string - (optional) use separator instead of inferring from the file extension
|
|
197
206
|
* pAxisIdx: index - (optional) the index of the primary axis (column in the input xsv); default 0
|
|
198
207
|
* pAxisName: string - (optional) the name of the primary axis (column name in the input xsv); default undefined
|
|
@@ -249,7 +258,7 @@ importFileMap := func(xsvMap, xsvType, spec, ...ops) {
|
|
|
249
258
|
result[id + ".spec"] = columnsSpec[id]
|
|
250
259
|
}
|
|
251
260
|
}
|
|
252
|
-
|
|
261
|
+
|
|
253
262
|
return result
|
|
254
263
|
}
|
|
255
264
|
|
|
@@ -10,6 +10,7 @@ constants := import("@platforma-sdk/workflow-tengo:constants")
|
|
|
10
10
|
oop := import("@platforma-sdk/workflow-tengo:oop")
|
|
11
11
|
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
12
12
|
tx := import("tx")
|
|
13
|
+
times := import("times")
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
_SUBSCRIPTION_FIELD := "subscription"
|
|
@@ -61,7 +62,7 @@ createUniversal := func(tpl, isEph, inputs) {
|
|
|
61
62
|
out := renderer.getFutureOutputField(tplutil.TEMPLATE_OUTPUT_PREFIX + name)
|
|
62
63
|
if len(cache) > 0 && cache[0] > 0 {
|
|
63
64
|
cache = cache[0]
|
|
64
|
-
tx.cacheSetToField(out.id, cache)
|
|
65
|
+
tx.cacheSetToField(out.id, cache * times.millisecond)
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
return out
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/workflow-tengo",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "Tengo SDK library",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"./dist/**/*"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@milaboratories/software-pframes-conv": "^1.6.
|
|
20
|
-
"@platforma-open/milaboratories.software-small-binaries": "^1.
|
|
19
|
+
"@milaboratories/software-pframes-conv": "^1.6.4",
|
|
20
|
+
"@platforma-open/milaboratories.software-small-binaries": "^1.14.4"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@platforma-sdk/tengo-builder": "^1.15.0"
|