@milaboratories/milaboratories.monetization-test.model 1.0.25 → 1.0.26

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.
@@ -1,16 +1,16 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/milaboratories.monetization-test.model@1.0.25 build /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
3
+ > @milaboratories/milaboratories.monetization-test.model@1.0.26 build /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
4
4
  > ts-builder build --target block-model && block-tools build-model
5
5
 
6
6
  Building block-model project...
7
7
  ↳ rollup -c /configs/rollup.block-model.config.js
8
8
  
9
9
  ./src/index.ts → dist, dist...
10
- created dist, dist in 2.1s
10
+ created dist, dist in 3.9s
11
11
  
12
12
  ./src/index.ts → dist...
13
13
  (!) Circular dependency
14
14
  ../../../../sdk/model/dist/components/PFrameForGraphs.js -> ../../../../sdk/model/dist/components/PlDataTable.js -> ../../../../sdk/model/dist/components/PFrameForGraphs.js
15
- created dist in 2s
15
+ created dist in 5.2s
16
16
  Build completed successfully
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/milaboratories.monetization-test.model@1.0.25 type-check /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
3
+ > @milaboratories/milaboratories.monetization-test.model@1.0.26 type-check /home/runner/_work/platforma/platforma/etc/blocks/monetization-test/model
4
4
  > ts-builder types --target block-model
5
5
 
6
6
  ↳ tsc --noEmit --project ./tsconfig.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @milaboratories/milaboratories.monetization-test.model
2
2
 
3
+ ## 1.0.26
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [64cee78]
8
+ - @platforma-sdk/model@1.45.17
9
+
3
10
  ## 1.0.25
4
11
 
5
12
  ### Patch Changes
package/dist/bundle.js CHANGED
@@ -4385,6 +4385,36 @@
4385
4385
  }
4386
4386
  }
4387
4387
  }
4388
+ /**
4389
+ * @param dataInfo - The source DataInfo object
4390
+ * @param cb - Callback, function that have access to every blob to visit them all
4391
+ * @returns Nothing
4392
+ */
4393
+ function visitDataInfo(dataInfo, cb) {
4394
+ switch (dataInfo.type) {
4395
+ case 'Json':
4396
+ // Json type doesn't contain blobs, so return as is
4397
+ break;
4398
+ case 'JsonPartitioned': {
4399
+ // Visit each blob in parts
4400
+ Object.values(dataInfo.parts).forEach(cb);
4401
+ break;
4402
+ }
4403
+ case 'BinaryPartitioned': {
4404
+ // Visit each index and values blob in parts
4405
+ Object.values(dataInfo.parts).forEach((chunk) => {
4406
+ cb(chunk.index);
4407
+ cb(chunk.values);
4408
+ });
4409
+ break;
4410
+ }
4411
+ case 'ParquetPartitioned': {
4412
+ // Visit each blob in parts
4413
+ Object.values(dataInfo.parts).forEach(cb);
4414
+ break;
4415
+ }
4416
+ }
4417
+ }
4388
4418
  /**
4389
4419
  * Type guard function that checks if the given value is a valid DataInfoEntries.
4390
4420
  *
@@ -6017,6 +6047,25 @@
6017
6047
  return parsePColumnData(acc);
6018
6048
  throw new Error(`Unexpected input type: ${typeof acc}`);
6019
6049
  }
6050
+ function isPColumnReady(c) {
6051
+ const isValues = (d) => Array.isArray(d);
6052
+ const isAccessor = (d) => d instanceof TreeNodeAccessor;
6053
+ let ready = true;
6054
+ if (isAccessor(c.data)) {
6055
+ ready &&= c.data.getIsReadyOrError();
6056
+ }
6057
+ else if (isDataInfo(c.data)) {
6058
+ visitDataInfo(c.data, (v) => ready &&= v.getIsReadyOrError());
6059
+ }
6060
+ else if (!isValues(c.data)) {
6061
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
6062
+ throw Error(`unsupported column data type: ${c.data}`);
6063
+ }
6064
+ return ready;
6065
+ }
6066
+ function allPColumnsReady(columns) {
6067
+ return columns.every(isPColumnReady);
6068
+ }
6020
6069
 
6021
6070
  function isPColumnValues(value) {
6022
6071
  if (!Array.isArray(value))
@@ -6821,6 +6870,8 @@
6821
6870
  // TODO remove all non-PColumn fields
6822
6871
  createPFrame(def) {
6823
6872
  this.verifyInlineAndExplicitColumnsSupport(def);
6873
+ if (!allPColumnsReady(def))
6874
+ return undefined;
6824
6875
  return this.ctx.createPFrame(def.map((c) => transformPColumnData(c)));
6825
6876
  }
6826
6877
  createPTable(def) {
@@ -6839,7 +6890,10 @@
6839
6890
  else {
6840
6891
  rawDef = this.patchPTableDef(def);
6841
6892
  }
6842
- this.verifyInlineAndExplicitColumnsSupport(extractAllColumns(rawDef.src));
6893
+ const columns = extractAllColumns(rawDef.src);
6894
+ this.verifyInlineAndExplicitColumnsSupport(columns);
6895
+ if (!allPColumnsReady(columns))
6896
+ return undefined;
6843
6897
  return this.ctx.createPTable(mapPTableDef(rawDef, (po) => transformPColumnData(po)));
6844
6898
  }
6845
6899
  /** @deprecated scheduled for removal from SDK */
@@ -6860,7 +6914,7 @@
6860
6914
  }
6861
6915
  }
6862
6916
 
6863
- var version = "1.45.0";
6917
+ var version = "1.45.17";
6864
6918
 
6865
6919
  const PlatformaSDKVersion = version;
6866
6920