@platforma-sdk/workflow-tengo 5.3.1 → 5.3.3
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/pt.lib.tengo +76 -1
- package/dist/tengo/lib/pt.util.lib.tengo +18 -4
- package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
- package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
- package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
- package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_to_json.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/exec.python.venv-bin-path.plj.gz +0 -0
- package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe-for-ui.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.parse-to-json.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
- package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/waiter.waiter.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/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
- package/package.json +3 -3
|
@@ -347,6 +347,81 @@ workflow := func() {
|
|
|
347
347
|
return _newDataFrame(self, finalDataFrameId)
|
|
348
348
|
},
|
|
349
349
|
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
frameFromColumnBundle: func(bundle, options) {
|
|
361
|
+
util.validateParamsForFrameFromColumnBundle(options)
|
|
362
|
+
|
|
363
|
+
decodeColumn := func(columnId) {
|
|
364
|
+
decoded := undefined
|
|
365
|
+
if is_string(columnId) {
|
|
366
|
+
decoded = json.decode(columnId)
|
|
367
|
+
} else if is_map(columnId) {
|
|
368
|
+
decoded = columnId
|
|
369
|
+
} else {
|
|
370
|
+
ll.panic("Invalid column ID type. Expected string or object.")
|
|
371
|
+
}
|
|
372
|
+
return decoded
|
|
373
|
+
}
|
|
374
|
+
isFilteredColumn := func(columnId) {
|
|
375
|
+
decoded := decodeColumn(columnId)
|
|
376
|
+
return is_map(decoded) && !is_undefined(decoded.source) && !is_undefined(decoded.axisFilters)
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
axes := options.axes
|
|
380
|
+
columns := options.columns
|
|
381
|
+
tsvBuilder := pframes.tsvFileBuilder()
|
|
382
|
+
axesHeaders := []
|
|
383
|
+
|
|
384
|
+
for idx, axis in axes {
|
|
385
|
+
tsvBuilder.setAxisHeader(axis.spec, axis.column)
|
|
386
|
+
axesHeaders = append(axesHeaders, axis.column)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
filteredColumns := []
|
|
390
|
+
for column in columns {
|
|
391
|
+
if (isFilteredColumn(column)) {
|
|
392
|
+
filteredColumns = append(filteredColumns, column)
|
|
393
|
+
} else {
|
|
394
|
+
tsvBuilder.add(bundle.getColumn(column))
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
mainDF := self.frame(tsvBuilder.buildForPT())
|
|
399
|
+
|
|
400
|
+
for column in filteredColumns {
|
|
401
|
+
decoded := decodeColumn(column)
|
|
402
|
+
source := decoded.source
|
|
403
|
+
axisFilters := decoded.axisFilters
|
|
404
|
+
|
|
405
|
+
tsv := pframes.tsvFileBuilder()
|
|
406
|
+
for axis in axes {
|
|
407
|
+
tsv.setAxisHeader(axis.spec, axis.column)
|
|
408
|
+
}
|
|
409
|
+
tsv.add(bundle.getColumn(source), { header: column })
|
|
410
|
+
df := self.frame(tsv.buildForPT())
|
|
411
|
+
joinColumns := slices.map(axes, func(axis) { return axis.column })
|
|
412
|
+
for axisFilter in axisFilters {
|
|
413
|
+
id := axesHeaders[axisFilter[0]]
|
|
414
|
+
value := axisFilter[1]
|
|
415
|
+
df = df.filter(exp.col(id).eq(exp.lit(value))).withoutColumns(id)
|
|
416
|
+
joinColumns = slices.filter(joinColumns, func(c) { return c != id } )
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
mainDF = mainDF.join(df, { on: joinColumns })
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return mainDF
|
|
423
|
+
},
|
|
424
|
+
|
|
350
425
|
_newAnonymousDataFrameId: func() {
|
|
351
426
|
anonymousDFCounter += 1
|
|
352
427
|
return "anonymous_" + string(anonymousDFCounter)
|
|
@@ -829,7 +904,7 @@ _newDataFrame = func(parentWorkflow, dfName) {
|
|
|
829
904
|
|
|
830
905
|
saveFrameDirect: func(frameName, params) {
|
|
831
906
|
ll.assert(len(frameName) > 0, "frameName must be a non-empty string")
|
|
832
|
-
util.
|
|
907
|
+
util.validateParamsForSaveFrameDirect(params)
|
|
833
908
|
|
|
834
909
|
specs := util.makeFrameSpecs(params)
|
|
835
910
|
parentWorkflow._saveFrameSpecs(frameName, specs)
|
|
@@ -19,7 +19,7 @@ _COLUMN_SCHEMA := {
|
|
|
19
19
|
`spec`: spec.P_COLUMN_OWN_SPEC_SCHEMA
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
_SAVE_FRAME_DIRECT_PARAMS_SCHEMA := {
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
`axes`: [_AXIS_SCHEMA],
|
|
@@ -33,8 +33,8 @@ _PARAMS_SCHEMA := {
|
|
|
33
33
|
`strict,?` : `bool`
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
validation.assertType(params,
|
|
36
|
+
validateParamsForSaveFrameDirect := func(params) {
|
|
37
|
+
validation.assertType(params, _SAVE_FRAME_DIRECT_PARAMS_SCHEMA, "Invalid params structure")
|
|
38
38
|
|
|
39
39
|
columns := {}
|
|
40
40
|
ll.assert(len(params.axes) > 0, "At least one axis is required")
|
|
@@ -82,6 +82,19 @@ validateParams := func(params) {
|
|
|
82
82
|
)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
_FRAME_FROM_COLUMN_BUNDLE_PARAMS_SCHEMA := {
|
|
86
|
+
|
|
87
|
+
`axes`: [_AXIS_SCHEMA],
|
|
88
|
+
|
|
89
|
+
`columns`: [`string`]
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
validateParamsForFrameFromColumnBundle := func(params) {
|
|
93
|
+
validation.assertType(params, _FRAME_FROM_COLUMN_BUNDLE_PARAMS_SCHEMA, "Invalid params structure")
|
|
94
|
+
ll.assert(len(params.axes) > 0, "At least one axis is required")
|
|
95
|
+
ll.assert(len(params.columns) > 0, "At least one column is required")
|
|
96
|
+
}
|
|
97
|
+
|
|
85
98
|
unique := func(list) {
|
|
86
99
|
uniqueMap := {}
|
|
87
100
|
for _, item in list {
|
|
@@ -171,7 +184,8 @@ makeFrameColumnRef := func(frameName, columnId) {
|
|
|
171
184
|
}
|
|
172
185
|
|
|
173
186
|
export ll.toStrict({
|
|
174
|
-
|
|
187
|
+
validateParamsForSaveFrameDirect: validateParamsForSaveFrameDirect,
|
|
188
|
+
validateParamsForFrameFromColumnBundle: validateParamsForFrameFromColumnBundle,
|
|
175
189
|
makeFrameSpecs: makeFrameSpecs,
|
|
176
190
|
makeWriteFrameStep: makeWriteFrameStep,
|
|
177
191
|
makeFrameColumnRef: makeFrameColumnRef
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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": "5.3.
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"description": "Tengo SDK library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@milaboratories/software-pframes-conv": "2.2.7",
|
|
20
|
-
"@platforma-open/milaboratories.software-small-binaries": "^1.15.
|
|
20
|
+
"@platforma-open/milaboratories.software-small-binaries": "^1.15.23",
|
|
21
21
|
"@platforma-open/milaboratories.software-ptabler": "1.12.4",
|
|
22
22
|
"@platforma-open/milaboratories.software-ptexter": "1.1.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@platforma-sdk/tengo-builder": "2.
|
|
25
|
+
"@platforma-sdk/tengo-builder": "2.3.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"type-check": "pl-tengo check",
|