@dataform/core 3.1.6-alpha.0 → 3.1.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/README.md +474 -0
- package/bundle.d.ts +159 -1
- package/bundle.js +1 -1
- package/core.proto +8 -0
- package/package.json +3 -30
- package/property_graph_config.proto +76 -17
package/core.proto
CHANGED
|
@@ -510,6 +510,10 @@ message GraphLabel {
|
|
|
510
510
|
bool import_all = 5;
|
|
511
511
|
repeated string import_except = 6;
|
|
512
512
|
bool is_default = 7;
|
|
513
|
+
// Key-value metadata pairs emitted in `OPTIONS(extensions=[...])` on the
|
|
514
|
+
// default label (populated from `ai_context.instructions` and JSON-serialized
|
|
515
|
+
// `ai_context.examples`).
|
|
516
|
+
map<string, string> extensions = 8;
|
|
513
517
|
}
|
|
514
518
|
|
|
515
519
|
message GraphField {
|
|
@@ -517,6 +521,10 @@ message GraphField {
|
|
|
517
521
|
string expression = 2;
|
|
518
522
|
string description = 3;
|
|
519
523
|
repeated string synonyms = 4;
|
|
524
|
+
// Key-value metadata pairs emitted in `OPTIONS(extensions=[...])` on the
|
|
525
|
+
// property or measure (populated from `ai_context.instructions` and
|
|
526
|
+
// JSON-serialized `ai_context.examples`).
|
|
527
|
+
map<string, string> extensions = 5;
|
|
520
528
|
}
|
|
521
529
|
|
|
522
530
|
message GraphEndpoint {
|
package/package.json
CHANGED
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"dependencies": {},
|
|
3
|
-
"pnpm": {
|
|
4
|
-
"onlyBuiltDependencies": [
|
|
5
|
-
"protobufjs",
|
|
6
|
-
"fsevents"
|
|
7
|
-
],
|
|
8
|
-
"overrides": {
|
|
9
|
-
"serialize-javascript": "^7.1.2",
|
|
10
|
-
"glob-parent": "^5.1.2",
|
|
11
|
-
"json-bigint": "^1.0.0",
|
|
12
|
-
"y18n": "^5.0.5",
|
|
13
|
-
"underscore": "^1.12.1",
|
|
14
|
-
"protobufjs": "^7.6.5",
|
|
15
|
-
"ansi-regex": "^3.0.1",
|
|
16
|
-
"node-fetch": "^2.6.7",
|
|
17
|
-
"mdurl": "2.0.0",
|
|
18
|
-
"wrap-ansi": "7.0.0",
|
|
19
|
-
"string-width": "4.1.0",
|
|
20
|
-
"@eslint-community/eslint-utils": "4.9.1",
|
|
21
|
-
"brace-expansion": "5.0.12",
|
|
22
|
-
"linkify-it": "^5.0.2",
|
|
23
|
-
"@eslint/plugin-kit": "0.7.2",
|
|
24
|
-
"@google-cloud/storage@7.19.0>uuid": "14.0.2",
|
|
25
|
-
"gaxios@6.7.1>uuid": "14.0.2",
|
|
26
|
-
"teeny-request@9.0.0>uuid": "14.0.2",
|
|
27
|
-
"fast-uri": "3.1.7"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
2
|
"homepage": "https://github.com/dataform-co/dataform",
|
|
31
3
|
"license": "Apache-2.0",
|
|
32
4
|
"keywords": [
|
|
@@ -42,8 +14,9 @@
|
|
|
42
14
|
"publishConfig": {
|
|
43
15
|
"access": "public"
|
|
44
16
|
},
|
|
45
|
-
"version": "3.1.6
|
|
17
|
+
"version": "3.1.6",
|
|
46
18
|
"name": "@dataform/core",
|
|
47
19
|
"description": "Dataform core API.",
|
|
48
|
-
"main": "bundle.js"
|
|
20
|
+
"main": "bundle.js",
|
|
21
|
+
"dependencies": {}
|
|
49
22
|
}
|
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
// specification (`version: 0.2.0.dev0/google`). At most one `graph.yaml` file
|
|
18
18
|
// is allowed per project in V1. Both `snake_case` (recommended in `graph.yaml`,
|
|
19
19
|
// e.g. `semantic_model`, `primary_key`, `from_columns`, `to_columns`,
|
|
20
|
-
// `ai_context`, `
|
|
21
|
-
// `include_dependent_assertions`) and
|
|
20
|
+
// `ai_context`, `custom_extensions`, `job_labels`,
|
|
21
|
+
// `depend_on_dependency_assertions`, `include_dependent_assertions`) and
|
|
22
|
+
// `camelCase` keys are accepted.
|
|
22
23
|
syntax = "proto3";
|
|
23
24
|
|
|
24
25
|
package dataform;
|
|
@@ -29,6 +30,8 @@ option java_multiple_files = true;
|
|
|
29
30
|
|
|
30
31
|
option go_package = "github.com/dataform-co/dataform/protos/dataform";
|
|
31
32
|
|
|
33
|
+
import "google/protobuf/struct.proto";
|
|
34
|
+
|
|
32
35
|
// Top-level configuration for a Dataform BigQuery Property Graph YAML file
|
|
33
36
|
// (`definitions/**/graph.yaml`), aligned with the Google Semantic Ontology V1
|
|
34
37
|
// specification (`version: 0.2.0.dev0/google`).
|
|
@@ -81,6 +84,11 @@ message SemanticModelConfig {
|
|
|
81
84
|
// Optional. Top-level aggregate metrics compiled as `MEASURE(...)` properties
|
|
82
85
|
// on target entities.
|
|
83
86
|
repeated GraphMetricConfig metrics = 7;
|
|
87
|
+
// Optional (`custom_extensions` in YAML). Vendor-scoped custom extension
|
|
88
|
+
// metadata blocks (`vendor_name` must not be `"GOOGLE"` in
|
|
89
|
+
// `0.2.0.dev0/google` documents). Accepted for Knowledge Catalog
|
|
90
|
+
// compatibility and omitted from generated BigQuery DDL.
|
|
91
|
+
repeated GraphCustomExtensionConfig custom_extensions = 8;
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
// Deployment target mapping for a semantic model (`deployments` in
|
|
@@ -129,7 +137,7 @@ message GraphEntityConfig {
|
|
|
129
137
|
// `DEFAULT LABEL OPTIONS(description=...)`.
|
|
130
138
|
string description = 6;
|
|
131
139
|
// Optional (`ai_context` in YAML). AI context metadata (`instructions`,
|
|
132
|
-
// `synonyms`, and `
|
|
140
|
+
// `synonyms`, `examples`, and `custom`) for the entity.
|
|
133
141
|
GraphAiContextConfig ai_context = 7;
|
|
134
142
|
// Optional. Properties exposed on the entity node table (`PROPERTIES (...)`).
|
|
135
143
|
// In `graph.yaml`, each item may be a bare column name string `"col"` or a
|
|
@@ -137,6 +145,11 @@ message GraphEntityConfig {
|
|
|
137
145
|
// entity), `PROPERTIES ALL COLUMNS` is emitted. Required when one or more
|
|
138
146
|
// `metrics` target the entity.
|
|
139
147
|
repeated GraphFieldConfig fields = 8;
|
|
148
|
+
// Optional (`custom_extensions` in YAML). Vendor-scoped custom extension
|
|
149
|
+
// metadata blocks (`vendor_name` must not be `"GOOGLE"` in
|
|
150
|
+
// `0.2.0.dev0/google` documents). Accepted for Knowledge Catalog
|
|
151
|
+
// compatibility and omitted from generated BigQuery DDL.
|
|
152
|
+
repeated GraphCustomExtensionConfig custom_extensions = 9;
|
|
140
153
|
}
|
|
141
154
|
|
|
142
155
|
// Wrapper for a single composite unique key column list on an entity
|
|
@@ -173,8 +186,13 @@ message GraphRelationshipConfig {
|
|
|
173
186
|
// `DEFAULT LABEL OPTIONS(description=...)`.
|
|
174
187
|
string description = 9;
|
|
175
188
|
// Optional (`ai_context` in YAML). AI context metadata (`instructions`,
|
|
176
|
-
// `synonyms`, and `
|
|
189
|
+
// `synonyms`, `examples`, and `custom`) for the relationship.
|
|
177
190
|
GraphAiContextConfig ai_context = 10;
|
|
191
|
+
// Optional (`custom_extensions` in YAML). Vendor-scoped custom extension
|
|
192
|
+
// metadata blocks (`vendor_name` must not be `"GOOGLE"` in
|
|
193
|
+
// `0.2.0.dev0/google` documents). Accepted for Knowledge Catalog
|
|
194
|
+
// compatibility and omitted from generated BigQuery DDL.
|
|
195
|
+
repeated GraphCustomExtensionConfig custom_extensions = 11;
|
|
178
196
|
}
|
|
179
197
|
|
|
180
198
|
// Dimension metadata for a property field on an entity (`dimension` in
|
|
@@ -211,8 +229,13 @@ message GraphFieldConfig {
|
|
|
211
229
|
// `OPTIONS(description=...)`.
|
|
212
230
|
string label = 6;
|
|
213
231
|
// Optional (`ai_context` in YAML). AI context metadata (`instructions`,
|
|
214
|
-
// `synonyms`, and `
|
|
232
|
+
// `synonyms`, `examples`, and `custom`) for the field.
|
|
215
233
|
GraphAiContextConfig ai_context = 7;
|
|
234
|
+
// Optional (`custom_extensions` in YAML). Vendor-scoped custom extension
|
|
235
|
+
// metadata blocks (`vendor_name` must not be `"GOOGLE"` in
|
|
236
|
+
// `0.2.0.dev0/google` documents). Accepted for Knowledge Catalog
|
|
237
|
+
// compatibility and omitted from generated BigQuery DDL.
|
|
238
|
+
repeated GraphCustomExtensionConfig custom_extensions = 8;
|
|
216
239
|
}
|
|
217
240
|
|
|
218
241
|
// A top-level aggregate metric definition (`metrics` in `graph.yaml`), compiled
|
|
@@ -226,10 +249,13 @@ message GraphMetricConfig {
|
|
|
226
249
|
// Required. Target entity name on whose node table the `MEASURE(...)`
|
|
227
250
|
// property is emitted.
|
|
228
251
|
string entity = 2;
|
|
229
|
-
// Required.
|
|
230
|
-
//
|
|
231
|
-
// `
|
|
232
|
-
// `
|
|
252
|
+
// Required. SQL aggregate or derived measure expression passed through as-is
|
|
253
|
+
// into `MEASURE(<expression>) AS <name>` (supporting `SUM`, `AVG`,
|
|
254
|
+
// `COUNT(<property>)`, `MIN`, `MAX`, `DISTINCT`, `CASE WHEN`, scalar
|
|
255
|
+
// arithmetic, and derived sibling measures via `AGG(<sibling_metric>)`).
|
|
256
|
+
// `COUNT(*)` and literal-only counts such as `COUNT(1)` are rejected at
|
|
257
|
+
// compile time because BigQuery requires every measure to aggregate at least
|
|
258
|
+
// one graph property.
|
|
233
259
|
string expression = 3;
|
|
234
260
|
// Optional. Human-readable description of the metric, folded into
|
|
235
261
|
// `OPTIONS(description=...)`.
|
|
@@ -238,25 +264,58 @@ message GraphMetricConfig {
|
|
|
238
264
|
// `OPTIONS(description=...)`.
|
|
239
265
|
string label = 5;
|
|
240
266
|
// Optional (`ai_context` in YAML). AI context metadata (`instructions`,
|
|
241
|
-
// `synonyms`, and `
|
|
267
|
+
// `synonyms`, `examples`, and `custom`) for the metric.
|
|
242
268
|
GraphAiContextConfig ai_context = 6;
|
|
269
|
+
// Optional. Informational data type metadata. Accepted by the parser but has
|
|
270
|
+
// no effect on the generated BigQuery DDL.
|
|
271
|
+
string datatype = 7;
|
|
272
|
+
// Optional (`custom_extensions` in YAML). Vendor-scoped custom extension
|
|
273
|
+
// metadata blocks (`vendor_name` must not be `"GOOGLE"` in
|
|
274
|
+
// `0.2.0.dev0/google` documents). Accepted for Knowledge Catalog
|
|
275
|
+
// compatibility and omitted from generated BigQuery DDL.
|
|
276
|
+
repeated GraphCustomExtensionConfig custom_extensions = 8;
|
|
243
277
|
}
|
|
244
278
|
|
|
245
279
|
// AI context metadata attached to a semantic model, entity, relationship, field,
|
|
246
280
|
// or metric (`ai_context` in `graph.yaml`). On entities and relationships,
|
|
247
281
|
// `DEFAULT LABEL OPTIONS(...)` is emitted before `PROPERTIES (...)`,
|
|
248
|
-
// `PROPERTIES ALL COLUMNS`, or `NO PROPERTIES`.
|
|
249
|
-
//
|
|
250
|
-
// `
|
|
282
|
+
// `PROPERTIES ALL COLUMNS`, or `NO PROPERTIES`. On entities, relationships,
|
|
283
|
+
// fields, and metrics, `synonyms` map to `OPTIONS(synonyms=[...])`, while
|
|
284
|
+
// non-empty `instructions` and JSON-serialized `examples` map to
|
|
285
|
+
// `OPTIONS(extensions=[("instructions", "..."), ("examples", "[...]")])`.
|
|
286
|
+
// Model-level `ai_context` populates `PropertyGraph.description` only.
|
|
251
287
|
message GraphAiContextConfig {
|
|
252
288
|
// Optional. Alternative names emitted as `OPTIONS(synonyms=[...])`.
|
|
253
289
|
repeated string synonyms = 1;
|
|
254
|
-
// Optional. Example values or questions
|
|
255
|
-
// (
|
|
290
|
+
// Optional. Example values or questions emitted as a JSON-serialized array in
|
|
291
|
+
// `OPTIONS(extensions=[("examples", "[...]")])` on labels, fields, and
|
|
292
|
+
// metrics (and folded into `PropertyGraph.description` on `semantic_model`).
|
|
256
293
|
repeated string examples = 2;
|
|
257
|
-
// Optional. Free-form AI instructions
|
|
258
|
-
//
|
|
294
|
+
// Optional. Free-form AI instructions emitted as
|
|
295
|
+
// `OPTIONS(extensions=[("instructions", "...")])` on labels, fields, and
|
|
296
|
+
// metrics (and folded into `PropertyGraph.description` on `semantic_model`).
|
|
259
297
|
string instructions = 3;
|
|
298
|
+
// Optional. Opaque mapping of custom AI context member names to arbitrary
|
|
299
|
+
// JSON/YAML values (preserving nested `snake_case` keys verbatim). Accepted
|
|
300
|
+
// for Knowledge Catalog compatibility and omitted from generated BigQuery
|
|
301
|
+
// DDL.
|
|
302
|
+
google.protobuf.Struct custom = 4;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Vendor-scoped custom extension metadata block attached to a semantic model,
|
|
306
|
+
// entity, relationship, field, or metric (`custom_extensions` in `graph.yaml`).
|
|
307
|
+
// Accepted for Knowledge Catalog compatibility and omitted from generated
|
|
308
|
+
// BigQuery DDL.
|
|
309
|
+
message GraphCustomExtensionConfig {
|
|
310
|
+
// Required (`vendor_name` in YAML). Non-empty third-party vendor identifier
|
|
311
|
+
// (`"GOOGLE"` in any casing is rejected in `0.2.0.dev0/google` documents,
|
|
312
|
+
// where Google extensions are declared as native keys).
|
|
313
|
+
string vendor_name = 1;
|
|
314
|
+
// Required. Opaque vendor-specific extension payload. In `graph.yaml`, either
|
|
315
|
+
// an opaque string (typically JSON, preserved verbatim) or a plain mapping
|
|
316
|
+
// object (normalized to a JSON string with nested keys preserved verbatim) is
|
|
317
|
+
// accepted.
|
|
318
|
+
string data = 2;
|
|
260
319
|
}
|
|
261
320
|
|
|
262
321
|
// Reference to another Dataform action as a backing table source
|