@platforma-sdk/workflow-tengo 5.7.1 → 5.7.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/pframes.lib.tengo +1 -0
- package/dist/tengo/lib/pframes.util.lib.tengo +7 -1
- package/dist/tengo/lib/pframes.xsv-builder.lib.tengo +2 -1
- package/dist/tengo/lib/pframes.xsv-import-file.lib.tengo +5 -1
- package/dist/tengo/lib/pframes.xsv-import-pt.lib.tengo +6 -1
- package/dist/tengo/lib/pframes.xsv.lib.tengo +2 -1
- package/dist/tengo/lib/pt.lib.tengo +25 -30
- package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
- 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.conda.create-env.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-parquet-pcolumn-chunk.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/pt.workflow-run.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 +1 -1
|
@@ -1106,5 +1106,6 @@ export ll.toStrict({
|
|
|
1106
1106
|
pColumnResourceMapDataBuilder: pColumnResourceMapDataBuilder,
|
|
1107
1107
|
tsvFileBuilder: func() { return xsvBuilder.xsvFileBuilder("tsv") },
|
|
1108
1108
|
csvFileBuilder: func() { return xsvBuilder.xsvFileBuilder("csv") },
|
|
1109
|
+
parquetFileBuilder: func() { return xsvBuilder.xsvFileBuilder("parquet") },
|
|
1109
1110
|
parseToJson: parseToJson
|
|
1110
1111
|
})
|
|
@@ -798,6 +798,11 @@ isStructuredPfMap := func(pf) {
|
|
|
798
798
|
return true
|
|
799
799
|
}
|
|
800
800
|
|
|
801
|
+
validateXsvType := func(xsvType) {
|
|
802
|
+
validation.assertType(xsvType, "string,regex=csv|tsv|parquet",
|
|
803
|
+
"xsvType must be one of [csv, tsv, parquet], found: %v", xsvType)
|
|
804
|
+
}
|
|
805
|
+
|
|
801
806
|
export ll.toStrict({
|
|
802
807
|
PFCONV_IMPORT_CFG_SCHEMA: PFCONV_IMPORT_CFG_SCHEMA,
|
|
803
808
|
PFCONV_EXPORT_CFG_SCHEMA: PFCONV_EXPORT_CFG_SCHEMA,
|
|
@@ -810,5 +815,6 @@ export ll.toStrict({
|
|
|
810
815
|
pFrameToColumnsMap: pFrameToColumnsMap,
|
|
811
816
|
addColumnToWd: addColumnToWd,
|
|
812
817
|
isFlatPfMap: isFlatPfMap,
|
|
813
|
-
isStructuredPfMap: isStructuredPfMap
|
|
818
|
+
isStructuredPfMap: isStructuredPfMap,
|
|
819
|
+
validateXsvType: validateXsvType
|
|
814
820
|
})
|
|
@@ -8,9 +8,10 @@ pBuilder := import("@platforma-sdk/workflow-tengo:pframes.builder")
|
|
|
8
8
|
xsv := import("@platforma-sdk/workflow-tengo:pframes.xsv")
|
|
9
9
|
canonical := import("@platforma-sdk/workflow-tengo:canonical")
|
|
10
10
|
execConstants := import("@platforma-sdk/workflow-tengo:exec.constants")
|
|
11
|
+
util := import("@platforma-sdk/workflow-tengo:pframes.util")
|
|
11
12
|
|
|
12
13
|
xsvFileBuilder := func(xsvType) {
|
|
13
|
-
|
|
14
|
+
util.validateXsvType(xsvType)
|
|
14
15
|
|
|
15
16
|
PTablerNA := "%%NA%%" // Constant for PTabler NA representation
|
|
16
17
|
naValueInternal := "" // Default NA value, can be changed by setNA
|
|
@@ -84,7 +84,7 @@ getColumnSpec := func(axesSpec, col) {
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
87
|
-
|
|
87
|
+
util.validateXsvType(xsvType)
|
|
88
88
|
|
|
89
89
|
validation.assertType(spec, util.PFCONV_IMPORT_CFG_SCHEMA)
|
|
90
90
|
|
|
@@ -106,6 +106,8 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
106
106
|
ops := renderOps({ dataOnly: false, splitDataAndSpec: false, queue: execConstants.LIGHT_QUEUE, inputCache: undefined }, ops...)
|
|
107
107
|
|
|
108
108
|
if ops.transpose != undefined {
|
|
109
|
+
ll.assert(xsvType != "parquet",
|
|
110
|
+
"transpose is not supported with xsvType 'parquet', please use 'csv' or 'tsv' instead")
|
|
109
111
|
|
|
110
112
|
tops := ops.transpose
|
|
111
113
|
|
|
@@ -170,6 +172,8 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
170
172
|
if storageFormat == "Parquet" {
|
|
171
173
|
return xsvImportPt.importFileParquet(xsvFile, xsvType, spec, ops)
|
|
172
174
|
}
|
|
175
|
+
ll.assert(xsvType != "parquet",
|
|
176
|
+
"storageFormat '%v' is not supported with xsvType 'parquet', please use storageFormat 'Parquet'", storageFormat)
|
|
173
177
|
|
|
174
178
|
|
|
175
179
|
pureSpec := util.purifySpec(spec)
|
|
@@ -59,9 +59,14 @@ applyNaRegex := func(colExpr, naRegex, colType) {
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
importFileParquet := func(xsvFile, xsvType, spec, ops) {
|
|
62
|
-
|
|
62
|
+
util.validateXsvType(xsvType)
|
|
63
63
|
|
|
64
64
|
validation.assertType(spec, util.PFCONV_IMPORT_CFG_SCHEMA)
|
|
65
|
+
if xsvType == "parquet" {
|
|
66
|
+
ll.assert(is_undefined(spec.separator), "separator is not supported with xsvType 'parquet'")
|
|
67
|
+
ll.assert(is_undefined(spec.commentLinePrefix), "commentLinePrefix is not supported with xsvType 'parquet'")
|
|
68
|
+
ll.assert(is_undefined(spec.skipEmptyLines), "skipEmptyLines is not supported with xsvType 'parquet'")
|
|
69
|
+
}
|
|
65
70
|
|
|
66
71
|
|
|
67
72
|
ll.assert(is_undefined(spec.index), "index axis is not supported with Parquet storage format")
|
|
@@ -89,7 +89,8 @@ getColumnSpec := func(axesSpec, col) {
|
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
92
|
-
ll.assert(xsvType == "csv" || xsvType == "tsv"
|
|
92
|
+
ll.assert(xsvType == "csv" || xsvType == "tsv" || xsvType == "parquet",
|
|
93
|
+
"expected one of [csv, tsv, parquet] types, found: %v", xsvType)
|
|
93
94
|
|
|
94
95
|
validation.assertType(spec, util.PFCONV_IMPORT_CFG_SCHEMA)
|
|
95
96
|
|
|
@@ -15,6 +15,7 @@ pframesSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
|
|
|
15
15
|
render := import("@platforma-sdk/workflow-tengo:render")
|
|
16
16
|
maps := import("@platforma-sdk/workflow-tengo:maps")
|
|
17
17
|
canonical := import("@platforma-sdk/workflow-tengo:canonical")
|
|
18
|
+
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
@@ -468,17 +469,14 @@ workflow := func() {
|
|
|
468
469
|
|
|
469
470
|
|
|
470
471
|
if !is_undefined(opts.format) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
472
|
+
validation.assertType(opts.format, "string,regex=csv|tsv|parquet|ndjson",
|
|
473
|
+
"format must be one of [csv, tsv, parquet, ndjson], found: %v", opts.format)
|
|
474
474
|
if !is_undefined(finalFormat) && finalFormat != opts.format {
|
|
475
475
|
ll.panic("format and xsvType from structural input cannot be used together. Got: %v and %v", opts.format, finalFormat)
|
|
476
476
|
}
|
|
477
477
|
finalFormat = opts.format
|
|
478
478
|
} else if !is_undefined(opts.xsvType) {
|
|
479
|
-
|
|
480
|
-
ll.panic("xsvType must be 'csv' or 'tsv'. Got: %v", opts.xsvType)
|
|
481
|
-
}
|
|
479
|
+
pframesUtil.validateXsvType(opts.xsvType)
|
|
482
480
|
if !is_undefined(finalFormat) && finalFormat != opts.xsvType {
|
|
483
481
|
ll.panic("opts.xsvType and xsvType from structural input cannot be used together. Got: %v and %v", opts.xsvType, finalFormat)
|
|
484
482
|
}
|
|
@@ -594,23 +592,23 @@ workflow := func() {
|
|
|
594
592
|
translation: translation
|
|
595
593
|
}
|
|
596
594
|
} else if finalFormat == "parquet" {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
595
|
+
step = {
|
|
596
|
+
type: "read_parquet",
|
|
597
|
+
file: finalFileName,
|
|
598
|
+
name: finalDataFrameId
|
|
599
|
+
}
|
|
600
|
+
} else if finalFormat == "ndjson" {
|
|
601
|
+
step = {
|
|
602
|
+
type: "read_ndjson",
|
|
603
|
+
file: finalFileName,
|
|
604
|
+
name: finalDataFrameId
|
|
605
|
+
}
|
|
606
|
+
} else { // csv or tsv
|
|
607
|
+
step = {
|
|
608
|
+
type: "read_csv",
|
|
609
|
+
file: finalFileName,
|
|
610
|
+
name: finalDataFrameId
|
|
611
|
+
}
|
|
614
612
|
|
|
615
613
|
if finalFormat == "csv" {
|
|
616
614
|
step.delimiter = ","
|
|
@@ -632,7 +630,7 @@ workflow := func() {
|
|
|
632
630
|
}
|
|
633
631
|
|
|
634
632
|
|
|
635
|
-
if !is_undefined(finalSchemaToUse) {
|
|
633
|
+
if !is_undefined(finalSchemaToUse) && finalFormat != "parquet" {
|
|
636
634
|
step.schema = finalSchemaToUse
|
|
637
635
|
}
|
|
638
636
|
|
|
@@ -1044,14 +1042,11 @@ _newDataFrame = func(parentWorkflow, dfName) {
|
|
|
1044
1042
|
|
|
1045
1043
|
|
|
1046
1044
|
if !is_undefined(opts.format) {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}
|
|
1045
|
+
validation.assertType(opts.format, "string,regex=csv|tsv|parquet|ndjson",
|
|
1046
|
+
"format must be one of [csv, tsv, parquet, ndjson], found: %v", opts.format)
|
|
1050
1047
|
finalFormat = opts.format
|
|
1051
1048
|
} else if !is_undefined(opts.xsvType) {
|
|
1052
|
-
|
|
1053
|
-
ll.panic("xsvType must be 'csv' or 'tsv'. Got: %v", opts.xsvType)
|
|
1054
|
-
}
|
|
1049
|
+
pframesUtil.validateXsvType(opts.xsvType)
|
|
1055
1050
|
finalFormat = opts.xsvType
|
|
1056
1051
|
} else {
|
|
1057
1052
|
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|