@pythia-software/query-table-react 0.9.5 → 0.9.6
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/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1387,6 +1387,8 @@ import {
|
|
|
1387
1387
|
metricPlans,
|
|
1388
1388
|
hasRegex as hasRegex2,
|
|
1389
1389
|
metricPopulationError,
|
|
1390
|
+
hasMetricSeries,
|
|
1391
|
+
planMetricSeries,
|
|
1390
1392
|
predicatesOf as predicatesOf3,
|
|
1391
1393
|
toAggregationQuery,
|
|
1392
1394
|
toMetricQuery,
|
|
@@ -1405,7 +1407,7 @@ function usesLocalMetricPage(clause, context) {
|
|
|
1405
1407
|
async function localMetrics(rows, query, context, signal) {
|
|
1406
1408
|
const originalClauses = query.aggregations ?? [];
|
|
1407
1409
|
const advanced = (query.aggregations ?? []).filter(
|
|
1408
|
-
(c) => context.strictLocalMetrics || c.dateGrouping || isComputedField3(c.field ?? "") || c.groupBy.some(isComputedField3) || c.diagnostics?.length || c.expression !== void 0 || c.expressionY !== void 0 || c.scope !== void 0 || c.distribution || c.sort || c.groupLimit !== void 0 || c.where !== void 0 || c.minCount !== void 0
|
|
1410
|
+
(c) => context.strictLocalMetrics || c.dateGrouping || isComputedField3(c.field ?? "") || c.groupBy.some(isComputedField3) || c.diagnostics?.length || c.expression !== void 0 || c.expressionY !== void 0 || c.scope !== void 0 || c.distribution || c.sort || c.groupLimit !== void 0 || c.where !== void 0 || c.minCount !== void 0 || hasMetricSeries(c)
|
|
1409
1411
|
);
|
|
1410
1412
|
if (advanced.length && (originalClauses.length > 20 || normalizeQueryState2(query).aggregations?.length !== originalClauses.length))
|
|
1411
1413
|
return evaluateMetrics(rows, query, context.schema, {
|
|
@@ -1515,6 +1517,16 @@ async function executeMetrics(query, context, signal) {
|
|
|
1515
1517
|
abort(signal);
|
|
1516
1518
|
const clauses = query.aggregations ?? [];
|
|
1517
1519
|
if (!clauses.length) return { metrics: [] };
|
|
1520
|
+
const series = planMetricSeries(query, context.schema, {
|
|
1521
|
+
...context.now !== void 0 ? { now: context.now } : {},
|
|
1522
|
+
...context.resolveComputed ? { resolveComputed: context.resolveComputed } : {}
|
|
1523
|
+
});
|
|
1524
|
+
if (series) {
|
|
1525
|
+
const parts = await Promise.all(
|
|
1526
|
+
series.queries.map((part) => executeMetrics(part, context, signal))
|
|
1527
|
+
);
|
|
1528
|
+
return { metrics: series.combine(parts.flatMap((part) => part.metrics)) };
|
|
1529
|
+
}
|
|
1518
1530
|
if (context.executeV3) return context.executeV3(query, signal);
|
|
1519
1531
|
if (context.rowsReady === false && clauses.some((c) => usesLocalMetricPage(c, context)))
|
|
1520
1532
|
throw Error("Wait for the current table page before previewing shown-row metrics.");
|