@platforma-sdk/workflow-tengo 5.4.3 → 5.4.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.
Files changed (44) hide show
  1. package/dist/tengo/lib/pframes.util.lib.tengo +3 -1
  2. package/dist/tengo/lib/pframes.xsv-builder.lib.tengo +11 -0
  3. package/dist/tengo/lib/pt.expression.lib.tengo +2 -1
  4. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  5. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  6. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  7. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  11. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  12. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  13. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  14. package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  21. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  22. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  23. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  24. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  25. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  29. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  30. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  31. package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
  32. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  38. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  39. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  40. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  41. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  42. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  43. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  44. package/package.json +1 -1
@@ -411,19 +411,21 @@ calculateGroupAxesIndices := func(numberOfAxes, aggregationIndices) {
411
411
  pFrameToColumnsMap := func(pf) {
412
412
  columnsById := {}
413
413
 
414
- addColumnSegment := func(key, value) {
414
+ addColumnSegment := func(key, field) {
415
415
  columnId := key[0:(len(key) - 5)]
416
416
  if is_undefined(columnsById[columnId]) {
417
417
  columnsById[columnId] = {}
418
418
  }
419
419
 
420
420
  if text.has_suffix(key, ".spec") {
421
+ value := smart.isField(field) ? field.getValue() : field
421
422
  if smart.isResource(value) {
422
423
  ll.assert(value.isFinal(), "Resource is not final")
423
424
  value = value.getDataAsJson()
424
425
  }
425
426
  columnsById[columnId].spec = value
426
427
  } else if text.has_suffix(key, ".data") {
428
+ value := smart.isField(field) && field.isSet() ? field.getValue() : field
427
429
  columnsById[columnId].data = value
428
430
  } else {
429
431
  ll.panic("unknown suffix: %s", key)
@@ -16,6 +16,7 @@ xsvFileBuilder := func(xsvType) {
16
16
  naValueInternal := "" // Default NA value, can be changed by setNA
17
17
 
18
18
  requests := []
19
+ headersMap := {}
19
20
  addedColumnInternalIds := {}
20
21
  localAxisHeaderOverrides := []
21
22
  distiller := undefined
@@ -254,6 +255,11 @@ xsvFileBuilder := func(xsvType) {
254
255
  pFrameKey := "col" + nextPFrameKeyIndex
255
256
  nextPFrameKeyIndex += 1
256
257
 
258
+ ll.assert(is_undefined(headersMap[header]),
259
+ "header '%s' is not unique, it is already used by %v, and now %v",
260
+ header, col.spec, headersMap[header])
261
+ headersMap[header] = col.spec
262
+
257
263
  requests = append(requests, {
258
264
  internalId: internalId,
259
265
  header: header,
@@ -313,6 +319,11 @@ xsvFileBuilder := func(xsvType) {
313
319
  pFrameKey := "col" + nextPFrameKeyIndex
314
320
  nextPFrameKeyIndex += 1
315
321
 
322
+ ll.assert(is_undefined(headersMap[header]),
323
+ "header '%s' is not unique, it is used for %v, and now %v",
324
+ header, col.spec, headersMap[header])
325
+ headersMap[header] = col.spec
326
+
316
327
  requests = append(requests, {
317
328
  internalId: internalId,
318
329
  header: header,
@@ -136,7 +136,7 @@ _newWindowExpression = func(expression, aggregation, currentAlias) {
136
136
 
137
137
 
138
138
  alias: func(newAlias) {
139
- ll.assert(is_string(newAlias), "alias must be a string")
139
+ ll.assert(is_string(newAlias) && newAlias != "", "alias must be a non-empty string")
140
140
  return _newWindowExpression(expression, aggregation, newAlias)
141
141
  },
142
142
 
@@ -251,6 +251,7 @@ _newExpression = func(expression) {
251
251
 
252
252
 
253
253
  alias: func(newAlias) {
254
+ ll.assert(is_string(newAlias) && newAlias != "", "alias must be a non-empty string")
254
255
  return _newExpression(func (ctx) {
255
256
  valueExpr := self._getExpression(ctx)
256
257
  return {type: "alias", value: valueExpr, name: newAlias}
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.4.3",
3
+ "version": "5.4.4",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",