@platforma-sdk/model 1.53.10 → 1.53.13
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/annotations/converter.cjs +11 -11
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +1 -1
- package/dist/annotations/converter.d.ts.map +1 -1
- package/dist/annotations/converter.js +11 -11
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.d.ts +2 -2
- package/dist/annotations/types.d.ts +4 -4
- package/dist/bconfig/index.d.ts +5 -5
- package/dist/bconfig/lambdas.d.ts +7 -7
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +3 -3
- package/dist/bconfig/normalization.js.map +1 -1
- package/dist/bconfig/types.cjs.map +1 -1
- package/dist/bconfig/types.d.ts +2 -2
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/types.js.map +1 -1
- package/dist/bconfig/util.d.ts +4 -4
- package/dist/bconfig/v3.d.ts +3 -3
- package/dist/block_api_v1.d.ts +2 -2
- package/dist/block_api_v1.d.ts.map +1 -1
- package/dist/block_api_v2.d.ts +2 -2
- package/dist/block_api_v2.d.ts.map +1 -1
- package/dist/block_api_v3.d.ts +3 -3
- package/dist/block_migrations.cjs +10 -10
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts.map +1 -1
- package/dist/block_migrations.js +10 -10
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +11 -11
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +8 -8
- package/dist/block_model.d.ts.map +1 -1
- package/dist/block_model.js +11 -11
- package/dist/block_model.js.map +1 -1
- package/dist/block_state_patch.d.ts +2 -2
- package/dist/block_state_util.cjs +1 -1
- package/dist/block_state_util.cjs.map +1 -1
- package/dist/block_state_util.d.ts +3 -3
- package/dist/block_state_util.js +1 -1
- package/dist/block_state_util.js.map +1 -1
- package/dist/block_storage.cjs +10 -10
- package/dist/block_storage.cjs.map +1 -1
- package/dist/block_storage.d.ts +2 -2
- package/dist/block_storage.d.ts.map +1 -1
- package/dist/block_storage.js +10 -10
- package/dist/block_storage.js.map +1 -1
- package/dist/block_storage_vm.cjs +22 -22
- package/dist/block_storage_vm.cjs.map +1 -1
- package/dist/block_storage_vm.d.ts +1 -1
- package/dist/block_storage_vm.d.ts.map +1 -1
- package/dist/block_storage_vm.js +22 -22
- package/dist/block_storage_vm.js.map +1 -1
- package/dist/builder.cjs +32 -23
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.ts +7 -7
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +32 -23
- package/dist/builder.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +7 -6
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +4 -4
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +7 -6
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filter.d.ts +14 -14
- package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.cjs +46 -46
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +10 -34
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.js +46 -46
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlAnnotations/index.d.ts +2 -2
- package/dist/components/PlAnnotations/types.d.ts +2 -2
- package/dist/components/PlDataTable.cjs +19 -20
- package/dist/components/PlDataTable.cjs.map +1 -1
- package/dist/components/PlDataTable.d.ts +27 -27
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlDataTable.js +19 -20
- package/dist/components/PlDataTable.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.cjs +2 -2
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +6 -6
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.js +2 -2
- package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
- package/dist/components/PlSelectionModel.cjs.map +1 -1
- package/dist/components/PlSelectionModel.d.ts +1 -1
- package/dist/components/PlSelectionModel.js.map +1 -1
- package/dist/components/index.d.ts +5 -5
- package/dist/config/actions.cjs +39 -39
- package/dist/config/actions.cjs.map +1 -1
- package/dist/config/actions.d.ts +9 -9
- package/dist/config/actions.d.ts.map +1 -1
- package/dist/config/actions.js +39 -39
- package/dist/config/actions.js.map +1 -1
- package/dist/config/actions_kinds.d.ts +30 -30
- package/dist/config/actions_kinds.d.ts.map +1 -1
- package/dist/config/index.d.ts +6 -6
- package/dist/config/model.d.ts +28 -28
- package/dist/config/model_meta.d.ts +1 -1
- package/dist/config/type_engine.d.ts +3 -3
- package/dist/config/type_util.d.ts +2 -2
- package/dist/env_value.cjs +1 -1
- package/dist/env_value.cjs.map +1 -1
- package/dist/env_value.js +1 -1
- package/dist/env_value.js.map +1 -1
- package/dist/filters/converter.cjs +36 -32
- package/dist/filters/converter.cjs.map +1 -1
- package/dist/filters/converter.d.ts +2 -2
- package/dist/filters/converter.d.ts.map +1 -1
- package/dist/filters/converter.js +36 -32
- package/dist/filters/converter.js.map +1 -1
- package/dist/filters/index.d.ts +2 -2
- package/dist/filters/types.d.ts +33 -33
- package/dist/filters/types.d.ts.map +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/internal.cjs +7 -7
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.ts +4 -4
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -7
- package/dist/internal.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/pframe.cjs +1 -1
- package/dist/pframe.cjs.map +1 -1
- package/dist/pframe.d.ts +1 -1
- package/dist/pframe.js +1 -1
- package/dist/pframe.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +23 -15
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +3 -3
- package/dist/pframe_utils/columns.d.ts.map +1 -1
- package/dist/pframe_utils/columns.js +23 -15
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +25 -25
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +3 -3
- package/dist/pframe_utils/index.d.ts.map +1 -1
- package/dist/pframe_utils/index.js +25 -25
- package/dist/pframe_utils/index.js.map +1 -1
- package/dist/platforma.d.ts +7 -7
- package/dist/platforma.d.ts.map +1 -1
- package/dist/raw_globals.cjs +4 -1
- package/dist/raw_globals.cjs.map +1 -1
- package/dist/raw_globals.d.ts +2 -2
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/raw_globals.js +4 -1
- package/dist/raw_globals.js.map +1 -1
- package/dist/ref_util.cjs +4 -4
- package/dist/ref_util.cjs.map +1 -1
- package/dist/ref_util.d.ts +1 -1
- package/dist/ref_util.js +4 -4
- package/dist/ref_util.js.map +1 -1
- package/dist/render/accessor.cjs +24 -24
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +10 -10
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/accessor.js +24 -24
- package/dist/render/accessor.js.map +1 -1
- package/dist/render/api.cjs +23 -23
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +11 -11
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +23 -23
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs.map +1 -1
- package/dist/render/future.d.ts +1 -1
- package/dist/render/future.js.map +1 -1
- package/dist/render/index.d.ts +6 -6
- package/dist/render/internal.cjs +4 -4
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +7 -7
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/internal.js +4 -4
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +1 -1
- package/dist/render/util/axis_filtering.cjs +48 -44
- package/dist/render/util/axis_filtering.cjs.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +2 -2
- package/dist/render/util/axis_filtering.js +48 -44
- package/dist/render/util/axis_filtering.js.map +1 -1
- package/dist/render/util/column_collection.cjs +42 -35
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +4 -4
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/column_collection.js +42 -35
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/index.d.ts +4 -4
- package/dist/render/util/label.cjs +15 -21
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +2 -2
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/label.js +15 -21
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +56 -54
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +5 -5
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.js +56 -54
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +6 -6
- package/dist/render/util/pframe_upgraders.cjs.map +1 -1
- package/dist/render/util/pframe_upgraders.d.ts +1 -1
- package/dist/render/util/pframe_upgraders.d.ts.map +1 -1
- package/dist/render/util/pframe_upgraders.js +6 -6
- package/dist/render/util/pframe_upgraders.js.map +1 -1
- package/dist/render/util/split_selectors.d.ts +1 -1
- package/dist/render/util/split_selectors.d.ts.map +1 -1
- package/dist/sdk_info.cjs.map +1 -1
- package/dist/sdk_info.js.map +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +23 -21
- package/src/annotations/converter.test.ts +98 -101
- package/src/annotations/converter.ts +21 -17
- package/src/annotations/index.ts +2 -2
- package/src/annotations/types.ts +4 -4
- package/src/bconfig/index.ts +5 -5
- package/src/bconfig/lambdas.ts +10 -12
- package/src/bconfig/normalization.ts +5 -5
- package/src/bconfig/types.ts +3 -5
- package/src/bconfig/util.ts +3 -3
- package/src/bconfig/v3.ts +3 -3
- package/src/block_api_v1.ts +7 -3
- package/src/block_api_v2.ts +7 -3
- package/src/block_api_v3.ts +3 -3
- package/src/block_migrations.test.ts +66 -67
- package/src/block_migrations.ts +16 -16
- package/src/block_model.ts +76 -140
- package/src/block_state_patch.ts +2 -2
- package/src/block_state_util.ts +4 -4
- package/src/block_storage.test.ts +106 -99
- package/src/block_storage.ts +22 -25
- package/src/block_storage_vm.ts +41 -35
- package/src/builder.ts +107 -95
- package/src/components/PFrameForGraphs.test.ts +261 -255
- package/src/components/PFrameForGraphs.ts +35 -22
- package/src/components/PlAnnotations/filter.ts +21 -15
- package/src/components/PlAnnotations/filters_ui.test.ts +230 -73
- package/src/components/PlAnnotations/filters_ui.ts +138 -105
- package/src/components/PlAnnotations/index.ts +2 -2
- package/src/components/PlAnnotations/types.ts +2 -2
- package/src/components/PlDataTable.ts +177 -164
- package/src/components/PlMultiSequenceAlignment.ts +11 -18
- package/src/components/PlSelectionModel.ts +1 -1
- package/src/components/index.ts +5 -5
- package/src/config/actions.ts +64 -59
- package/src/config/actions_kinds.ts +38 -34
- package/src/config/index.ts +6 -6
- package/src/config/model.ts +28 -28
- package/src/config/model_meta.ts +1 -1
- package/src/config/type_engine.ts +3 -3
- package/src/config/type_util.ts +2 -2
- package/src/env_value.ts +2 -2
- package/src/filters/converter.test.ts +185 -144
- package/src/filters/converter.ts +47 -35
- package/src/filters/index.ts +2 -2
- package/src/filters/types.ts +44 -39
- package/src/global.d.ts +1 -1
- package/src/index.ts +24 -24
- package/src/internal.ts +27 -17
- package/src/pframe.ts +3 -3
- package/src/pframe_utils/columns.ts +81 -31
- package/src/pframe_utils/index.ts +65 -43
- package/src/platforma.ts +44 -21
- package/src/raw_globals.ts +13 -7
- package/src/ref_util.ts +6 -6
- package/src/render/accessor.ts +43 -44
- package/src/render/api.ts +102 -78
- package/src/render/future.ts +2 -2
- package/src/render/index.ts +6 -6
- package/src/render/internal.ts +11 -12
- package/src/render/traversal_ops.ts +1 -1
- package/src/render/util/axis_filtering.ts +67 -52
- package/src/render/util/column_collection.ts +171 -91
- package/src/render/util/index.ts +4 -4
- package/src/render/util/label.test.ts +139 -139
- package/src/render/util/label.ts +42 -33
- package/src/render/util/pcolumn_data.ts +111 -75
- package/src/render/util/pframe_upgraders.ts +24 -13
- package/src/render/util/split_selectors.ts +6 -1
- package/src/sdk_info.ts +1 -1
- package/src/typing.test.ts +56 -56
- package/src/version.ts +1 -1
package/src/render/api.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type {
|
|
|
24
24
|
ResultCollection,
|
|
25
25
|
SUniversalPColumnId,
|
|
26
26
|
ValueOrError,
|
|
27
|
-
} from
|
|
27
|
+
} from "@milaboratories/pl-model-common";
|
|
28
28
|
import {
|
|
29
29
|
AnchoredIdDeriver,
|
|
30
30
|
ensurePColumn,
|
|
@@ -41,22 +41,29 @@ import {
|
|
|
41
41
|
readAnnotation,
|
|
42
42
|
selectorsToPredicate,
|
|
43
43
|
withEnrichments,
|
|
44
|
-
} from
|
|
45
|
-
import canonicalize from
|
|
46
|
-
import type { Optional } from
|
|
47
|
-
import { getCfgRenderCtx } from
|
|
48
|
-
import { TreeNodeAccessor, ifDef } from
|
|
49
|
-
import type { FutureRef } from
|
|
50
|
-
import type { AccessorHandle, GlobalCfgRenderCtx } from
|
|
51
|
-
import { MainAccessorName, StagingAccessorName } from
|
|
52
|
-
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
import {
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
} from "@milaboratories/pl-model-common";
|
|
45
|
+
import canonicalize from "canonicalize";
|
|
46
|
+
import type { Optional } from "utility-types";
|
|
47
|
+
import { getCfgRenderCtx } from "../internal";
|
|
48
|
+
import { TreeNodeAccessor, ifDef } from "./accessor";
|
|
49
|
+
import type { FutureRef } from "./future";
|
|
50
|
+
import type { AccessorHandle, GlobalCfgRenderCtx } from "./internal";
|
|
51
|
+
import { MainAccessorName, StagingAccessorName } from "./internal";
|
|
52
|
+
import {
|
|
53
|
+
PColumnCollection,
|
|
54
|
+
type AxisLabelProvider,
|
|
55
|
+
type ColumnProvider,
|
|
56
|
+
} from "./util/column_collection";
|
|
57
|
+
import type { LabelDerivationOps } from "./util/label";
|
|
58
|
+
import { deriveLabels } from "./util/label";
|
|
59
|
+
import type { APColumnSelectorWithSplit } from "./util/split_selectors";
|
|
60
|
+
import { patchInSetFilters } from "./util/pframe_upgraders";
|
|
61
|
+
import { allPColumnsReady } from "./util";
|
|
62
|
+
|
|
63
|
+
export type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> =
|
|
64
|
+
| TreeEntry
|
|
65
|
+
| DataInfo<TreeEntry>
|
|
66
|
+
| PColumnValues;
|
|
60
67
|
|
|
61
68
|
/**
|
|
62
69
|
* Helper function to match domain objects
|
|
@@ -138,18 +145,19 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
138
145
|
predicateOrSelector: ((spec: PObjectSpec) => boolean) | PColumnSelector | PColumnSelector[],
|
|
139
146
|
opts?: GetOptionsOpts | ((spec: PObjectSpec, ref: PlRef) => string) | LabelDerivationOps,
|
|
140
147
|
): Option[] {
|
|
141
|
-
const predicate =
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
const predicate =
|
|
149
|
+
typeof predicateOrSelector === "function"
|
|
150
|
+
? predicateOrSelector
|
|
151
|
+
: selectorsToPredicate(predicateOrSelector);
|
|
144
152
|
const filtered = this.getSpecs().entries.filter((s) => predicate(s.obj));
|
|
145
153
|
|
|
146
154
|
let labelOps: LabelDerivationOps | ((spec: PObjectSpec, ref: PlRef) => string) = {};
|
|
147
155
|
let refsWithEnrichments: boolean = false;
|
|
148
|
-
if (typeof opts !==
|
|
149
|
-
if (typeof opts ===
|
|
156
|
+
if (typeof opts !== "undefined") {
|
|
157
|
+
if (typeof opts === "function") {
|
|
150
158
|
labelOps = opts;
|
|
151
|
-
} else if (typeof opts ===
|
|
152
|
-
if (
|
|
159
|
+
} else if (typeof opts === "object") {
|
|
160
|
+
if ("includeNativeLabel" in opts || "separator" in opts || "addLabelAsSuffix" in opts) {
|
|
153
161
|
labelOps = opts;
|
|
154
162
|
} else {
|
|
155
163
|
opts = opts as GetOptionsOpts;
|
|
@@ -159,11 +167,13 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
159
167
|
}
|
|
160
168
|
}
|
|
161
169
|
|
|
162
|
-
if (typeof labelOps ===
|
|
163
|
-
return deriveLabels(filtered, (o) => o.obj, labelOps ?? {}).map(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
if (typeof labelOps === "object")
|
|
171
|
+
return deriveLabels(filtered, (o) => o.obj, labelOps ?? {}).map(
|
|
172
|
+
({ value: { ref }, label }) => ({
|
|
173
|
+
ref: withEnrichments(ref, refsWithEnrichments),
|
|
174
|
+
label,
|
|
175
|
+
}),
|
|
176
|
+
);
|
|
167
177
|
else
|
|
168
178
|
return filtered.map(({ ref, obj }) => ({
|
|
169
179
|
ref: withEnrichments(ref, refsWithEnrichments),
|
|
@@ -171,14 +181,15 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
171
181
|
}));
|
|
172
182
|
}
|
|
173
183
|
|
|
174
|
-
public resolveAnchorCtx(
|
|
184
|
+
public resolveAnchorCtx(
|
|
185
|
+
anchorsOrCtx: AnchoredIdDeriver | Record<string, PColumnSpec | PlRef>,
|
|
186
|
+
): AnchoredIdDeriver | undefined {
|
|
175
187
|
if (anchorsOrCtx instanceof AnchoredIdDeriver) return anchorsOrCtx;
|
|
176
188
|
const resolvedAnchors: Record<string, PColumnSpec> = {};
|
|
177
189
|
for (const [key, value] of Object.entries(anchorsOrCtx)) {
|
|
178
190
|
if (isPlRef(value)) {
|
|
179
191
|
const resolvedSpec = this.getPColumnSpecByRef(value);
|
|
180
|
-
if (!resolvedSpec)
|
|
181
|
-
return undefined;
|
|
192
|
+
if (!resolvedSpec) return undefined;
|
|
182
193
|
resolvedAnchors[key] = resolvedSpec;
|
|
183
194
|
} else {
|
|
184
195
|
resolvedAnchors[key] = value;
|
|
@@ -197,7 +208,10 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
197
208
|
*/
|
|
198
209
|
public getAnchoredPColumns(
|
|
199
210
|
anchorsOrCtx: AnchoredIdDeriver | Record<string, PColumnSpec | PlRef>,
|
|
200
|
-
predicateOrSelectors:
|
|
211
|
+
predicateOrSelectors:
|
|
212
|
+
| ((spec: PColumnSpec) => boolean)
|
|
213
|
+
| APColumnSelectorWithSplit
|
|
214
|
+
| APColumnSelectorWithSplit[],
|
|
201
215
|
opts?: UniversalPColumnOpts,
|
|
202
216
|
): PColumn<PColumnDataUniversal>[] | undefined {
|
|
203
217
|
const anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);
|
|
@@ -242,7 +256,10 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
242
256
|
*/
|
|
243
257
|
getCanonicalOptions(
|
|
244
258
|
anchorsOrCtx: AnchoredIdDeriver | Record<string, PColumnSpec | PlRef>,
|
|
245
|
-
predicateOrSelectors:
|
|
259
|
+
predicateOrSelectors:
|
|
260
|
+
| ((spec: PColumnSpec) => boolean)
|
|
261
|
+
| APColumnSelectorWithSplit
|
|
262
|
+
| APColumnSelectorWithSplit[],
|
|
246
263
|
opts?: UniversalPColumnOpts,
|
|
247
264
|
): { label: string; value: SUniversalPColumnId }[] | undefined {
|
|
248
265
|
const anchorCtx = this.resolveAnchorCtx(anchorsOrCtx);
|
|
@@ -286,13 +303,13 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
286
303
|
* @deprecated use getDataWithErrors()
|
|
287
304
|
*/
|
|
288
305
|
public getDataWithErrorsFromResultPool(): ResultCollection<
|
|
289
|
-
Optional<PObject<ValueOrError<TreeNodeAccessor, Error>>,
|
|
306
|
+
Optional<PObject<ValueOrError<TreeNodeAccessor, Error>>, "id">
|
|
290
307
|
> {
|
|
291
308
|
return this.getDataWithErrors();
|
|
292
309
|
}
|
|
293
310
|
|
|
294
311
|
public getDataWithErrors(): ResultCollection<
|
|
295
|
-
Optional<PObject<ValueOrError<TreeNodeAccessor, Error>>,
|
|
312
|
+
Optional<PObject<ValueOrError<TreeNodeAccessor, Error>>, "id">
|
|
296
313
|
> {
|
|
297
314
|
const result = this.ctx.getDataWithErrorsFromResultPool();
|
|
298
315
|
return {
|
|
@@ -327,17 +344,14 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
327
344
|
*/
|
|
328
345
|
public getDataByRef(ref: PlRef): PObject<TreeNodeAccessor> | undefined {
|
|
329
346
|
// @TODO remove after 1 Jan 2025; forward compatibility
|
|
330
|
-
if (typeof this.ctx.getDataFromResultPoolByRef ===
|
|
347
|
+
if (typeof this.ctx.getDataFromResultPoolByRef === "undefined")
|
|
331
348
|
return this.getData().entries.find(
|
|
332
349
|
(f) => f.ref.blockId === ref.blockId && f.ref.name === ref.name,
|
|
333
350
|
)?.obj;
|
|
334
351
|
const data = this.ctx.getDataFromResultPoolByRef(ref.blockId, ref.name); // Keep original call
|
|
335
352
|
// Need to handle undefined case before mapping
|
|
336
353
|
if (!data) return undefined;
|
|
337
|
-
return mapPObjectData(
|
|
338
|
-
data,
|
|
339
|
-
(handle) => new TreeNodeAccessor(handle, [ref.blockId, ref.name]),
|
|
340
|
-
);
|
|
354
|
+
return mapPObjectData(data, (handle) => new TreeNodeAccessor(handle, [ref.blockId, ref.name]));
|
|
341
355
|
}
|
|
342
356
|
|
|
343
357
|
/**
|
|
@@ -432,13 +446,13 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
432
446
|
|
|
433
447
|
const spec = column.obj.spec;
|
|
434
448
|
if (
|
|
435
|
-
spec.name === PColumnName.Label
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
449
|
+
spec.name === PColumnName.Label &&
|
|
450
|
+
spec.axesSpec.length === 1 &&
|
|
451
|
+
spec.axesSpec[0].name === axis.name &&
|
|
452
|
+
spec.axesSpec[0].type === axis.type &&
|
|
453
|
+
matchDomain(axis.domain, spec.axesSpec[0].domain)
|
|
440
454
|
) {
|
|
441
|
-
if (column.obj.data.resourceType.name !==
|
|
455
|
+
if (column.obj.data.resourceType.name !== "PColumnData/Json") {
|
|
442
456
|
throw Error(`Expected JSON column for labels, got: ${column.obj.data.resourceType.name}`);
|
|
443
457
|
}
|
|
444
458
|
const labels: Record<string | number, string> = Object.fromEntries(
|
|
@@ -465,7 +479,7 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
465
479
|
public selectColumns(
|
|
466
480
|
selectors: ((spec: PColumnSpec) => boolean) | PColumnSelector | PColumnSelector[],
|
|
467
481
|
): PColumn<TreeNodeAccessor | undefined>[] {
|
|
468
|
-
const predicate = typeof selectors ===
|
|
482
|
+
const predicate = typeof selectors === "function" ? selectors : selectorsToPredicate(selectors);
|
|
469
483
|
|
|
470
484
|
const matchedSpecs = this.getSpecs().entries.filter(({ obj: spec }) => {
|
|
471
485
|
if (!isPColumnSpec(spec)) return false;
|
|
@@ -499,15 +513,20 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
499
513
|
* Find labels data for a given axis id of a p-column.
|
|
500
514
|
* @returns a map of axis value => label
|
|
501
515
|
*/
|
|
502
|
-
public findLabelsForColumnAxis(
|
|
516
|
+
public findLabelsForColumnAxis(
|
|
517
|
+
column: PColumnSpec,
|
|
518
|
+
axisIdx: number,
|
|
519
|
+
): Record<string | number, string> | undefined {
|
|
503
520
|
const labels = this.findLabels(column.axesSpec[axisIdx]);
|
|
504
521
|
if (!labels) return undefined;
|
|
505
522
|
const axisKeys = readAnnotation(column, `pl7.app/axisKeys/${axisIdx}`);
|
|
506
523
|
if (axisKeys !== undefined) {
|
|
507
524
|
const keys = JSON.parse(axisKeys) as string[];
|
|
508
|
-
return Object.fromEntries(
|
|
509
|
-
|
|
510
|
-
|
|
525
|
+
return Object.fromEntries(
|
|
526
|
+
keys.map((key) => {
|
|
527
|
+
return [key, labels[key] ?? "Unlabelled"];
|
|
528
|
+
}),
|
|
529
|
+
);
|
|
511
530
|
} else {
|
|
512
531
|
return labels;
|
|
513
532
|
}
|
|
@@ -527,7 +546,7 @@ export abstract class RenderCtxBase<Args, Data> {
|
|
|
527
546
|
public get data(): Data {
|
|
528
547
|
if (this._dataCache === undefined) {
|
|
529
548
|
const raw = this.ctx.data;
|
|
530
|
-
const value = typeof raw ===
|
|
549
|
+
const value = typeof raw === "function" ? raw() : raw;
|
|
531
550
|
this._dataCache = { v: value ? JSON.parse(value) : ({} as Data) };
|
|
532
551
|
}
|
|
533
552
|
return this._dataCache.v;
|
|
@@ -543,7 +562,7 @@ export abstract class RenderCtxBase<Args, Data> {
|
|
|
543
562
|
public get activeArgs(): Args | undefined {
|
|
544
563
|
if (this._activeArgsCache === undefined) {
|
|
545
564
|
const raw = this.ctx.activeArgs;
|
|
546
|
-
const value = typeof raw ===
|
|
565
|
+
const value = typeof raw === "function" ? raw() : raw;
|
|
547
566
|
this._activeArgsCache = {
|
|
548
567
|
v: value ? JSON.parse(value) : undefined,
|
|
549
568
|
};
|
|
@@ -582,15 +601,22 @@ export abstract class RenderCtxBase<Args, Data> {
|
|
|
582
601
|
return this.resultPool.findLabels(axis);
|
|
583
602
|
}
|
|
584
603
|
|
|
585
|
-
private verifyInlineAndExplicitColumnsSupport(
|
|
586
|
-
|
|
604
|
+
private verifyInlineAndExplicitColumnsSupport(
|
|
605
|
+
columns: (PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>)[],
|
|
606
|
+
) {
|
|
607
|
+
const hasInlineColumns = columns.some(
|
|
608
|
+
(c) => !(c.data instanceof TreeNodeAccessor) || isDataInfo(c.data),
|
|
609
|
+
); // Updated check for DataInfo
|
|
587
610
|
const inlineColumnsSupport = this.ctx.featureFlags?.inlineColumnsSupport === true;
|
|
588
|
-
if (hasInlineColumns && !inlineColumnsSupport)
|
|
611
|
+
if (hasInlineColumns && !inlineColumnsSupport)
|
|
612
|
+
throw Error(`Inline or explicit columns not supported`); // Combined check
|
|
589
613
|
|
|
590
614
|
// Removed redundant explicitColumns check
|
|
591
615
|
}
|
|
592
616
|
|
|
593
|
-
private patchPTableDef(
|
|
617
|
+
private patchPTableDef(
|
|
618
|
+
def: PTableDef<PColumn<PColumnDataUniversal>>,
|
|
619
|
+
): PTableDef<PColumn<PColumnDataUniversal>> {
|
|
594
620
|
if (!this.ctx.featureFlags?.pTablePartitionFiltersSupport) {
|
|
595
621
|
// For old desktop move all partition filters to filters field as it doesn't read partitionFilters field
|
|
596
622
|
def = {
|
|
@@ -610,12 +636,12 @@ export abstract class RenderCtxBase<Args, Data> {
|
|
|
610
636
|
}
|
|
611
637
|
|
|
612
638
|
// TODO remove all non-PColumn fields
|
|
613
|
-
public createPFrame(
|
|
639
|
+
public createPFrame(
|
|
640
|
+
def: PFrameDef<PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>>,
|
|
641
|
+
): PFrameHandle | undefined {
|
|
614
642
|
this.verifyInlineAndExplicitColumnsSupport(def);
|
|
615
643
|
if (!allPColumnsReady(def)) return undefined;
|
|
616
|
-
return this.ctx.createPFrame(
|
|
617
|
-
def.map((c) => transformPColumnData(c)),
|
|
618
|
-
);
|
|
644
|
+
return this.ctx.createPFrame(def.map((c) => transformPColumnData(c)));
|
|
619
645
|
}
|
|
620
646
|
|
|
621
647
|
// TODO remove all non-PColumn fields
|
|
@@ -630,18 +656,18 @@ export abstract class RenderCtxBase<Args, Data> {
|
|
|
630
656
|
def:
|
|
631
657
|
| PTableDef<PColumn<PColumnDataUniversal>>
|
|
632
658
|
| {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
659
|
+
columns: PColumn<PColumnDataUniversal>[];
|
|
660
|
+
filters?: PTableRecordFilter[];
|
|
661
|
+
/** Table sorting */
|
|
662
|
+
sorting?: PTableSorting[];
|
|
663
|
+
},
|
|
638
664
|
): PTableHandle | undefined {
|
|
639
665
|
let rawDef: PTableDef<PColumn<PColumnDataUniversal>>;
|
|
640
|
-
if (
|
|
666
|
+
if ("columns" in def) {
|
|
641
667
|
rawDef = this.patchPTableDef({
|
|
642
668
|
src: {
|
|
643
|
-
type:
|
|
644
|
-
entries: def.columns.map((c) => ({ type:
|
|
669
|
+
type: "full",
|
|
670
|
+
entries: def.columns.map((c) => ({ type: "column", column: c })),
|
|
645
671
|
},
|
|
646
672
|
partitionFilters: def.filters ?? [],
|
|
647
673
|
filters: [],
|
|
@@ -653,9 +679,7 @@ export abstract class RenderCtxBase<Args, Data> {
|
|
|
653
679
|
const columns = extractAllColumns(rawDef.src);
|
|
654
680
|
this.verifyInlineAndExplicitColumnsSupport(columns);
|
|
655
681
|
if (!allPColumnsReady(columns)) return undefined;
|
|
656
|
-
return this.ctx.createPTable(
|
|
657
|
-
mapPTableDef(rawDef, (po) => transformPColumnData(po)),
|
|
658
|
-
);
|
|
682
|
+
return this.ctx.createPTable(mapPTableDef(rawDef, (po) => transformPColumnData(po)));
|
|
659
683
|
}
|
|
660
684
|
|
|
661
685
|
/** @deprecated scheduled for removal from SDK */
|
|
@@ -686,7 +710,7 @@ export class RenderCtx<Args, Data> extends RenderCtxBase<Args, Data> {
|
|
|
686
710
|
public get args(): Args | undefined {
|
|
687
711
|
if (this._argsCache === undefined) {
|
|
688
712
|
const raw = this.ctx.args;
|
|
689
|
-
const value = typeof raw ===
|
|
713
|
+
const value = typeof raw === "function" ? raw() : raw;
|
|
690
714
|
// args can be undefined when derivation fails (e.g., validation error in args())
|
|
691
715
|
this._argsCache = { v: value === undefined ? undefined : JSON.parse(value) };
|
|
692
716
|
}
|
|
@@ -700,7 +724,7 @@ export class RenderCtxLegacy<Args, UiState> extends RenderCtxBase<Args, UiState>
|
|
|
700
724
|
public get args(): Args {
|
|
701
725
|
if (this._argsCache === undefined) {
|
|
702
726
|
const raw = this.ctx.args;
|
|
703
|
-
const value = typeof raw ===
|
|
727
|
+
const value = typeof raw === "function" ? raw() : raw;
|
|
704
728
|
this._argsCache = { v: JSON.parse(value) };
|
|
705
729
|
}
|
|
706
730
|
return this._argsCache.v;
|
|
@@ -711,7 +735,7 @@ export class RenderCtxLegacy<Args, UiState> extends RenderCtxBase<Args, UiState>
|
|
|
711
735
|
public get uiState(): UiState {
|
|
712
736
|
if (this._uiStateCache === undefined) {
|
|
713
737
|
const raw = this.ctx.uiState!;
|
|
714
|
-
const value = typeof raw ===
|
|
738
|
+
const value = typeof raw === "function" ? raw() : raw;
|
|
715
739
|
this._uiStateCache = { v: value ? JSON.parse(value) : ({} as UiState) };
|
|
716
740
|
}
|
|
717
741
|
return this._uiStateCache.v;
|
|
@@ -719,11 +743,11 @@ export class RenderCtxLegacy<Args, UiState> extends RenderCtxBase<Args, UiState>
|
|
|
719
743
|
}
|
|
720
744
|
|
|
721
745
|
export type RenderFunction<Args = unknown, State = unknown, Ret = unknown> = (
|
|
722
|
-
rCtx: RenderCtx<Args, State
|
|
746
|
+
rCtx: RenderCtx<Args, State>,
|
|
723
747
|
) => Ret;
|
|
724
748
|
|
|
725
749
|
export type RenderFunctionLegacy<Args = unknown, State = unknown, Ret = unknown> = (
|
|
726
|
-
rCtx: RenderCtxLegacy<Args, State
|
|
750
|
+
rCtx: RenderCtxLegacy<Args, State>,
|
|
727
751
|
) => Ret;
|
|
728
752
|
|
|
729
753
|
export type UnwrapFutureRef<K> =
|
package/src/render/future.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FutureAwait, FutureHandle } from
|
|
2
|
-
import { registerFutureAwait } from
|
|
1
|
+
import type { FutureAwait, FutureHandle } from "./internal";
|
|
2
|
+
import { registerFutureAwait } from "../internal";
|
|
3
3
|
|
|
4
4
|
export class FutureRef<T = unknown> {
|
|
5
5
|
private isResolved = false;
|
package/src/render/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export { type ExtractFutureRefType } from
|
|
6
|
-
export { FutureRef } from
|
|
1
|
+
export * from "./api";
|
|
2
|
+
export * from "./traversal_ops";
|
|
3
|
+
export * from "./accessor";
|
|
4
|
+
export * from "./util";
|
|
5
|
+
export { type ExtractFutureRefType } from "./future";
|
|
6
|
+
export { FutureRef } from "./future";
|
package/src/render/internal.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Optional } from
|
|
2
|
-
import type { Branded } from
|
|
3
|
-
import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from
|
|
1
|
+
import type { Optional } from "utility-types";
|
|
2
|
+
import type { Branded } from "../branding";
|
|
3
|
+
import type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from "./traversal_ops";
|
|
4
4
|
import type {
|
|
5
5
|
ArchiveFormat,
|
|
6
6
|
AnyFunction,
|
|
@@ -18,16 +18,15 @@ import type {
|
|
|
18
18
|
ValueOrError,
|
|
19
19
|
DataInfo,
|
|
20
20
|
RangeBytes,
|
|
21
|
-
} from
|
|
21
|
+
} from "@milaboratories/pl-model-common";
|
|
22
22
|
|
|
23
|
-
export const StagingAccessorName =
|
|
24
|
-
export const MainAccessorName =
|
|
23
|
+
export const StagingAccessorName = "staging";
|
|
24
|
+
export const MainAccessorName = "main";
|
|
25
25
|
|
|
26
|
-
export type AccessorHandle = Branded<string,
|
|
27
|
-
export type FutureHandle = Branded<string,
|
|
26
|
+
export type AccessorHandle = Branded<string, "AccessorHandle">;
|
|
27
|
+
export type FutureHandle = Branded<string, "FutureHandle">;
|
|
28
28
|
|
|
29
29
|
export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
|
|
30
|
-
|
|
31
30
|
//
|
|
32
31
|
// Root accessor creation
|
|
33
32
|
//
|
|
@@ -128,7 +127,7 @@ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = F
|
|
|
128
127
|
getDataFromResultPool(): ResultCollection<PObject<AHandle>>;
|
|
129
128
|
|
|
130
129
|
getDataWithErrorsFromResultPool(): ResultCollection<
|
|
131
|
-
Optional<PObject<ValueOrError<AHandle, Error>>,
|
|
130
|
+
Optional<PObject<ValueOrError<AHandle, Error>>, "id">
|
|
132
131
|
>;
|
|
133
132
|
|
|
134
133
|
getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
|
|
@@ -200,7 +199,7 @@ export type FutureAwait = {
|
|
|
200
199
|
};
|
|
201
200
|
|
|
202
201
|
export function isFutureAwait(obj: unknown): obj is FutureAwait {
|
|
203
|
-
return typeof obj ===
|
|
202
|
+
return typeof obj === "object" && obj !== null && "__awaited_futures__" in obj;
|
|
204
203
|
}
|
|
205
204
|
|
|
206
205
|
function addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unknown) {
|
|
@@ -208,7 +207,7 @@ function addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unkno
|
|
|
208
207
|
visited.add(node);
|
|
209
208
|
|
|
210
209
|
const type = typeof node;
|
|
211
|
-
if (type ===
|
|
210
|
+
if (type === "object") {
|
|
212
211
|
if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));
|
|
213
212
|
else if (Array.isArray(node))
|
|
214
213
|
for (const nested of node) addAllFutureAwaits(set, visited, nested);
|
|
@@ -20,7 +20,7 @@ export type CommonFieldTraverseOps = {
|
|
|
20
20
|
stableIfNotFound?: true;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
export type FieldType =
|
|
23
|
+
export type FieldType = "Input" | "Output" | "Service" | "OTW" | "Dynamic" | "MTW";
|
|
24
24
|
|
|
25
25
|
export interface ResourceType {
|
|
26
26
|
readonly name: string;
|
|
@@ -9,8 +9,8 @@ import type {
|
|
|
9
9
|
BinaryPartitionedDataInfoEntries,
|
|
10
10
|
ParquetPartitionedDataInfoEntries,
|
|
11
11
|
PartitionedDataInfoEntries,
|
|
12
|
-
} from
|
|
13
|
-
import type { AxisFilterByIdx } from
|
|
12
|
+
} from "@milaboratories/pl-model-common";
|
|
13
|
+
import type { AxisFilterByIdx } from "@milaboratories/pl-model-common";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Filters DataInfoEntries using axis filters, removing specified axes from keys and
|
|
@@ -50,20 +50,22 @@ export function filterDataInfoEntries<Blob>(
|
|
|
50
50
|
// Check for invalid filter axes
|
|
51
51
|
const { type } = dataInfoEntries;
|
|
52
52
|
switch (type) {
|
|
53
|
-
case
|
|
53
|
+
case "Json": {
|
|
54
54
|
const { keyLength } = dataInfoEntries;
|
|
55
55
|
for (const [axisIdx] of axisFilters)
|
|
56
56
|
if (axisIdx >= keyLength)
|
|
57
57
|
throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
|
-
case
|
|
61
|
-
case
|
|
62
|
-
case
|
|
60
|
+
case "JsonPartitioned":
|
|
61
|
+
case "BinaryPartitioned":
|
|
62
|
+
case "ParquetPartitioned": {
|
|
63
63
|
const { partitionKeyLength } = dataInfoEntries;
|
|
64
64
|
for (const [axisIdx] of axisFilters)
|
|
65
65
|
if (axisIdx >= partitionKeyLength)
|
|
66
|
-
throw new Error(
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`,
|
|
68
|
+
);
|
|
67
69
|
break;
|
|
68
70
|
}
|
|
69
71
|
default:
|
|
@@ -72,9 +74,7 @@ export function filterDataInfoEntries<Blob>(
|
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
const keyMatchesFilters = (key: PColumnKey): boolean => {
|
|
75
|
-
for (const [axisIdx, axisValue] of sortedFilters)
|
|
76
|
-
if (key[axisIdx] !== axisValue)
|
|
77
|
-
return false;
|
|
77
|
+
for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;
|
|
78
78
|
return true;
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -82,52 +82,67 @@ export function filterDataInfoEntries<Blob>(
|
|
|
82
82
|
const newKey = [...key];
|
|
83
83
|
|
|
84
84
|
// Remove axes in descending order to maintain correct indices
|
|
85
|
-
for (const [axisIdx] of sortedFilters)
|
|
86
|
-
newKey.splice(axisIdx, 1);
|
|
85
|
+
for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);
|
|
87
86
|
|
|
88
87
|
return newKey;
|
|
89
88
|
};
|
|
90
89
|
|
|
91
90
|
switch (dataInfoEntries.type) {
|
|
92
|
-
case
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
91
|
+
case "Json":
|
|
92
|
+
return {
|
|
93
|
+
type: "Json",
|
|
94
|
+
keyLength: dataInfoEntries.keyLength - axisFilters.length,
|
|
95
|
+
data: dataInfoEntries.data
|
|
96
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
97
|
+
.map(
|
|
98
|
+
(entry) =>
|
|
99
|
+
({
|
|
100
|
+
key: removeFilteredAxes(entry.key),
|
|
101
|
+
value: entry.value,
|
|
102
|
+
}) satisfies PColumnDataEntry<PColumnValue>,
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
case "JsonPartitioned":
|
|
106
|
+
return {
|
|
107
|
+
type: "JsonPartitioned",
|
|
108
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
109
|
+
parts: dataInfoEntries.parts
|
|
110
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
111
|
+
.map(
|
|
112
|
+
(entry) =>
|
|
113
|
+
({
|
|
114
|
+
key: removeFilteredAxes(entry.key),
|
|
115
|
+
value: entry.value,
|
|
116
|
+
}) satisfies PColumnDataEntry<Blob>,
|
|
117
|
+
),
|
|
118
|
+
};
|
|
119
|
+
case "BinaryPartitioned":
|
|
120
|
+
return {
|
|
121
|
+
type: "BinaryPartitioned",
|
|
122
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
123
|
+
parts: dataInfoEntries.parts
|
|
124
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
125
|
+
.map(
|
|
126
|
+
(entry) =>
|
|
127
|
+
({
|
|
128
|
+
key: removeFilteredAxes(entry.key),
|
|
129
|
+
value: entry.value,
|
|
130
|
+
}) satisfies PColumnDataEntry<BinaryChunk<Blob>>,
|
|
131
|
+
),
|
|
132
|
+
};
|
|
133
|
+
case "ParquetPartitioned":
|
|
134
|
+
return {
|
|
135
|
+
type: "ParquetPartitioned",
|
|
136
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
137
|
+
parts: dataInfoEntries.parts
|
|
138
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
139
|
+
.map(
|
|
140
|
+
(entry) =>
|
|
141
|
+
({
|
|
142
|
+
key: removeFilteredAxes(entry.key),
|
|
143
|
+
value: entry.value,
|
|
144
|
+
}) satisfies PColumnDataEntry<Blob>,
|
|
145
|
+
),
|
|
146
|
+
};
|
|
132
147
|
}
|
|
133
148
|
}
|