@platforma-sdk/workflow-tengo 6.5.1 → 6.6.1

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.
Files changed (50) hide show
  1. package/dist/tengo/lib/pframes.process-column-batch.lib.tengo +59 -5
  2. package/dist/tengo/lib/pframes.process-pcolumn-batch-helpers.lib.tengo +35 -1
  3. package/dist/tengo/lib/workdir.dirs.lib.tengo +28 -0
  4. package/dist/tengo/lib/workdir.lib.tengo +3 -1
  5. package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
  6. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  7. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  11. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  12. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  13. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  14. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  21. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  22. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  23. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  24. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  25. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.build-table.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
  29. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  30. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  31. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  32. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.merge-resource-maps.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.process-pcolumn-batch-split.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.process-pcolumn-batch.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  38. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  39. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  40. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  41. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  42. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  43. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  44. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  45. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  46. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  47. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  48. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  49. package/dist/tengo/tpl/workflow.query-context-filter.plj.gz +0 -0
  50. package/package.json +3 -3
@@ -12,6 +12,12 @@
12
12
 
13
13
 
14
14
 
15
+
16
+
17
+
18
+
19
+
20
+
15
21
 
16
22
  ll := import("@platforma-sdk/workflow-tengo:ll")
17
23
  maps := import("@platforma-sdk/workflow-tengo:maps")
@@ -231,13 +237,13 @@ processColumnBatch := func(input, bodyTpl, outputs, opts) {
231
237
 
232
238
 
233
239
 
240
+
241
+
242
+
234
243
  batchKeyColumnsNames := output.settings.batchKeyColumns
235
244
  ll.assert(!is_undefined(batchKeyColumnsNames),
236
245
  "Xsv output %q is missing settings.batchKeyColumns (required in batch mode; list the axis names emitted by the body)",
237
246
  output.name)
238
- ll.assert(is_undefined(output.settings.axes),
239
- "Xsv output %q cannot set both batchKeyColumns and axes in settings; these are mutually exclusive — keep batchKeyColumns only",
240
- output.name)
241
247
 
242
248
  batchAxes := slices.map(batchKeyColumnsNames, func(colName) {
243
249
  axSpec := batchKeyAxisByName[colName]
@@ -247,14 +253,62 @@ processColumnBatch := func(input, bodyTpl, outputs, opts) {
247
253
  return { column: colName, spec: axSpec }
248
254
  })
249
255
 
256
+ additionalAxes := slices.normalize(output.settings.axes)
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ _outputHeaders := {}
267
+ _axisNames := {}
268
+ for axSpec in isolationAxesSpec {
269
+ _axisNames[axSpec.name] = "isolation axis"
270
+ }
271
+ for axName in batchKeyColumnsNames {
272
+ _outputHeaders[axName] = "batch-key axis"
273
+ _axisNames[axName] = "batch-key axis"
274
+ }
275
+ for col in output.settings.columns {
276
+ _outputHeaders[col.column] = "value column"
277
+ }
278
+ for axis in additionalAxes {
279
+ priorHeader := _outputHeaders[axis.column]
280
+ ll.assert(is_undefined(priorHeader),
281
+ "Xsv output %q: additional axis column %q collides with %s of the same name; rename one of them",
282
+ output.name, axis.column, priorHeader)
283
+ _outputHeaders[axis.column] = "additional axis"
284
+
285
+ priorName := _axisNames[axis.spec.name]
286
+ ll.assert(is_undefined(priorName),
287
+ "Xsv output %q: additional axis %q has spec.name %q colliding with %s; give every axis a unique name",
288
+ output.name, axis.column, axis.spec.name, priorName)
289
+ _axisNames[axis.spec.name] = "additional axis"
290
+ }
291
+
292
+
293
+
294
+
295
+
296
+ storageFormat := output.settings.storageFormat
297
+ if is_undefined(storageFormat) {
298
+ storageFormat = "Parquet"
299
+ }
300
+ ll.assert(storageFormat == "Json" || storageFormat == "Binary" || storageFormat == "Parquet",
301
+ "Xsv output %q has invalid storageFormat %q; expected \"Json\", \"Binary\", or \"Parquet\"",
302
+ output.name, storageFormat)
250
303
 
251
304
 
252
305
 
253
306
 
254
307
  modifiedSettings := maps.merge(output.settings, {
255
- axes: batchAxes,
308
+ axes: batchAxes + additionalAxes,
256
309
  batchKeyColumns: undefined,
257
- partitionKeyLength: 0
310
+ partitionKeyLength: 0,
311
+ storageFormat: storageFormat
258
312
  })
259
313
  decomposition := pUtil.decomposePfconvImportCfg(modifiedSettings, {
260
314
  additionalAxesSpec: iterationAxesSpec
@@ -233,10 +233,44 @@ groupColumnData := func(data, isolationIndices, batchKeyIndices, batchKeyLength,
233
233
  return groups
234
234
  }
235
235
 
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ xsvDataResTypes := func(storageFormat) {
250
+ if storageFormat == "Binary" {
251
+ return {
252
+ partitioned: pConstants.RTYPE_P_COLUMN_DATA_BINARY_PARTITIONED,
253
+ superPartitioned: pConstants.RTYPE_P_COLUMN_DATA_BINARY_SUPER_PARTITIONED
254
+ }
255
+ } else if storageFormat == "Json" {
256
+ return {
257
+ partitioned: pConstants.RTYPE_P_COLUMN_DATA_JSON_PARTITIONED,
258
+ superPartitioned: pConstants.RTYPE_P_COLUMN_DATA_JSON_SUPER_PARTITIONED
259
+ }
260
+ } else if storageFormat == "Parquet" {
261
+ return {
262
+ partitioned: pConstants.RTYPE_P_COLUMN_DATA_PARQUET_PARTITIONED,
263
+ superPartitioned: pConstants.RTYPE_P_COLUMN_DATA_PARQUET_SUPER_PARTITIONED
264
+ }
265
+ }
266
+ ll.panic("Unknown storageFormat for batch Xsv output: %v (expected \"Json\", \"Binary\", or \"Parquet\")", storageFormat)
267
+ }
268
+
236
269
  export ll.toStrict({
237
270
  resolveData: resolveData,
238
271
  classifyPColumnData: classifyPColumnData,
239
272
  recordsInGroup: recordsInGroup,
240
273
  forEachOutputField: forEachOutputField,
241
- groupColumnData: groupColumnData
274
+ groupColumnData: groupColumnData,
275
+ xsvDataResTypes: xsvDataResTypes
242
276
  })
@@ -0,0 +1,28 @@
1
+
2
+
3
+
4
+
5
+ ll := import("@platforma-sdk/workflow-tengo:ll")
6
+ sets := import("@platforma-sdk/workflow-tengo:sets")
7
+ path := import("@platforma-sdk/workflow-tengo:path")
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+ addNestedDirs := func(set, dir) {
23
+ return sets.add(set, path.getBasenameDirs(dir)...)
24
+ }
25
+
26
+ export ll.toStrict({
27
+ addNestedDirs: addNestedDirs
28
+ })
@@ -16,6 +16,7 @@ oop := import("@platforma-sdk/workflow-tengo:oop")
16
16
  sets := import("@platforma-sdk/workflow-tengo:sets")
17
17
  slices := import("@platforma-sdk/workflow-tengo:slices")
18
18
  path := import("@platforma-sdk/workflow-tengo:path")
19
+ workdirDirs := import("@platforma-sdk/workflow-tengo:workdir.dirs")
19
20
  render := import("@platforma-sdk/workflow-tengo:render")
20
21
  maps := import("@platforma-sdk/workflow-tengo:maps")
21
22
 
@@ -327,7 +328,8 @@ _fill := func() {
327
328
 
328
329
 
329
330
  mkDir: func(dir) {
330
- sets.add(dirs, path.getBasenameDirs(dir))
331
+ validation.assertType(dir, "string")
332
+ dirs = workdirDirs.addNestedDirs(dirs, dir)
331
333
  return self
332
334
  },
333
335
 
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": "6.5.1",
3
+ "version": "6.6.1",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -16,14 +16,14 @@
16
16
  "./dist/**/*"
17
17
  ],
18
18
  "dependencies": {
19
- "@milaboratories/pframes-rs-wasip2": "1.1.44",
19
+ "@milaboratories/pframes-rs-wasip2": "1.1.46",
20
20
  "@milaboratories/software-pframes-conv": "2.2.9",
21
21
  "@platforma-open/milaboratories.software-small-binaries": "^2.1.1",
22
22
  "@platforma-open/milaboratories.software-ptabler": "2.1.1",
23
23
  "@platforma-open/milaboratories.software-ptexter": "1.2.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@platforma-sdk/tengo-builder": "4.0.7"
26
+ "@platforma-sdk/tengo-builder": "4.0.8"
27
27
  },
28
28
  "scripts": {
29
29
  "type-check": "pl-tengo check",