@rasmusengelbrecht/pi-semantic-query 0.1.2 → 0.1.3
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/README.md +17 -0
- package/extensions/semantic-query.ts +5 -1
- package/package.json +1 -1
- package/skills/semantic-query/SKILL.md +17 -0
package/README.md
CHANGED
|
@@ -85,6 +85,23 @@ Example request shape for `semantic_compile`:
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
For target series, pass `targetTable`. Use `targetProject` and `targetSchema` when the warehouse needs a qualified target relation but you want to keep the table name generic:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"metricId": "revenue",
|
|
93
|
+
"period": "current year",
|
|
94
|
+
"dialect": "bigquery",
|
|
95
|
+
"targetProject": "warehouse-project",
|
|
96
|
+
"targetSchema": "analytics",
|
|
97
|
+
"targetTable": "metric_targets",
|
|
98
|
+
"request": {
|
|
99
|
+
"timeGrain": "monthly",
|
|
100
|
+
"targetSeries": "budget_current"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
88
105
|
## Safety boundary
|
|
89
106
|
|
|
90
107
|
This package is compile-only by design. `semantic_compile` returns SQL; it does not run the SQL. Query execution touches credentials, cost, and data access, so execution should stay in the caller's existing warehouse tooling or a separate explicitly configured integration.
|
|
@@ -65,7 +65,9 @@ const CompileParams = Type.Intersect([
|
|
|
65
65
|
Type.Literal("json"),
|
|
66
66
|
Type.Literal("explain"),
|
|
67
67
|
], { description: "Output format. Defaults to sql." })),
|
|
68
|
-
targetTable: Type.Optional(Type.String({ description: "Optional target table for targetSeries requests." })),
|
|
68
|
+
targetTable: Type.Optional(Type.String({ description: "Optional target table for targetSeries requests. May be fully qualified, or bare when targetProject/targetSchema are supplied." })),
|
|
69
|
+
targetProject: Type.Optional(Type.String({ description: "Optional target table project/catalog." })),
|
|
70
|
+
targetSchema: Type.Optional(Type.String({ description: "Optional target table schema/dataset." })),
|
|
69
71
|
targetMetricColumn: Type.Optional(Type.String({ description: "Target metric id column. Defaults to metric_id." })),
|
|
70
72
|
targetSeriesColumn: Type.Optional(Type.String({ description: "Target series column. Defaults to target_series." })),
|
|
71
73
|
targetTimeColumn: Type.Optional(Type.String({ description: "Target time column. Defaults to metric_time." })),
|
|
@@ -249,6 +251,8 @@ export default function semanticQueryExtension(pi: ExtensionAPI) {
|
|
|
249
251
|
if (params.dialect) args.push("--dialect", params.dialect);
|
|
250
252
|
if (params.format) args.push("--format", params.format);
|
|
251
253
|
if (params.targetTable) args.push("--target-table", params.targetTable);
|
|
254
|
+
if (params.targetProject) args.push("--target-project", params.targetProject);
|
|
255
|
+
if (params.targetSchema) args.push("--target-schema", params.targetSchema);
|
|
252
256
|
if (params.targetMetricColumn) args.push("--target-metric-column", params.targetMetricColumn);
|
|
253
257
|
if (params.targetSeriesColumn) args.push("--target-series-column", params.targetSeriesColumn);
|
|
254
258
|
if (params.targetTimeColumn) args.push("--target-time-column", params.targetTimeColumn);
|
package/package.json
CHANGED
|
@@ -32,6 +32,23 @@ Prefer period-based requests for CLI/agent workflows:
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
For target series, pass `targetTable`. If the warehouse needs qualified table names, prefer generic relation parts instead of hard-coded company presets:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"metricId": "revenue",
|
|
40
|
+
"period": "current year",
|
|
41
|
+
"dialect": "bigquery",
|
|
42
|
+
"targetProject": "warehouse-project",
|
|
43
|
+
"targetSchema": "analytics",
|
|
44
|
+
"targetTable": "metric_targets",
|
|
45
|
+
"request": {
|
|
46
|
+
"timeGrain": "monthly",
|
|
47
|
+
"targetSeries": "budget_current"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
35
52
|
Use raw `fromDate` / `toDate` only when the user needs exact fixed boundaries or provides a request JSON shape that already has them.
|
|
36
53
|
|
|
37
54
|
## Safety boundary
|