Skip to content

Add PropertyGraph action class - #2246

Merged
rafal-hawrylak merged 1 commit into
mainfrom
pr/property-graph-action-class
Aug 18, 2026
Merged

Add PropertyGraph action class#2246
rafal-hawrylak merged 1 commit into
mainfrom
pr/property-graph-action-class

Conversation

@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

Introduces core/actions/property_graph.ts implementing the PropertyGraph action for BigQuery Property Graph DDL generation. The class parses PropertyGraphConfig, applies normalization (scalar keys, string field shorthand, joinKeys array shorthand, default label synthesis, wildcard expansion), validates cross-entity references and emits the NODE TABLES / EDGE TABLES graph body.

Catalog-based data sources (BigLake/Iceberg 4-part references) are parsed but rejected at compile time until project-wide 4-part Target support lands.

Adds 26 direct-instantiation unit tests covering happy path, edge cases and error paths. Remaining tests requiring session-registered actions and runMainInVm are deferred.

Files:

  • core/actions/property_graph.ts (new)
  • core/actions/property_graph_test.ts (new)
  • core/BUILD

Introduces core/actions/property_graph.ts implementing the PropertyGraph
action for BigQuery Property Graph DDL generation. The class parses
PropertyGraphConfig, applies normalization (scalar keys, string field
shorthand, joinKeys array shorthand, default label synthesis, wildcard
expansion), validates cross-entity references and emits the NODE
TABLES / EDGE TABLES graph body.

Catalog-based data sources (BigLake/Iceberg 4-part references) are
parsed but rejected at compile time until project-wide 4-part Target
support lands.

Adds 26 direct-instantiation unit tests covering happy path, edge
cases and error paths. Remaining tests requiring session-registered
actions and runMainInVm are deferred.

Files:
- core/actions/property_graph.ts (new)
- core/actions/property_graph_test.ts (new)
- core/BUILD
@rafal-hawrylak
rafal-hawrylak requested a review from a team as a code owner August 18, 2026 06:24
@rafal-hawrylak
rafal-hawrylak requested review from Tuseeq1 and removed request for fernst August 18, 2026 09:08
Comment thread core/actions/property_graph.ts
}

function parseTablePath(path: string, where: string): dataform.Target {
const parts = path.split(".");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it's more complicated

for example my-project.my_dataset.table.view` may be a valid identifier

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear what do you mean. Is it about backtick?
Is this the value you say is valid: my-project.my_dataset.table.view` ?
Or this one: my-project.my_dataset.table.view ?

Comment thread core/actions/property_graph_test.ts
Comment thread core/actions/property_graph_test.ts
@rafal-hawrylak
rafal-hawrylak merged commit feb3d7d into main Aug 18, 2026
11 checks passed
@rafal-hawrylak
rafal-hawrylak deleted the pr/property-graph-action-class branch August 18, 2026 21:34
rafal-hawrylak added a commit that referenced this pull request Aug 19, 2026
- Drop duplicate arity check in buildEndpoint. The post-defaults check
  in validateEndpointReferences catches the same case with a clearer
  message.
- Compare whole compiled objects in the minimal and relationship tests
  including the full graphBody string.
apilaskowski pushed a commit that referenced this pull request Aug 19, 2026
Bumps the npm package version to release the `PropertyGraph` action
(#2243, #2246, #2249) and JiT assertion integration (#2185, #2223).
rafal-hawrylak added a commit that referenced this pull request Aug 19, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.
rafal-hawrylak added a commit that referenced this pull request Aug 20, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.
rafal-hawrylak added a commit that referenced this pull request Aug 20, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.
rafal-hawrylak added a commit that referenced this pull request Aug 20, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.
rafal-hawrylak added a commit that referenced this pull request Aug 21, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.
rafal-hawrylak added a commit that referenced this pull request Aug 21, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.
rafal-hawrylak added a commit that referenced this pull request Aug 24, 2026
Introduces core/actions/property_graph.ts implementing the PropertyGraph
action for BigQuery Property Graph DDL generation. The class parses
PropertyGraphConfig, applies normalization (scalar keys, string field
shorthand, joinKeys array shorthand, default label synthesis, wildcard
expansion), validates cross-entity references and emits the NODE
TABLES / EDGE TABLES graph body.

Catalog-based data sources (BigLake/Iceberg 4-part references) are
parsed but rejected at compile time until project-wide 4-part Target
support lands.

Adds 26 direct-instantiation unit tests covering happy path, edge
cases and error paths. Remaining tests requiring session-registered
actions and runMainInVm are deferred.

Files:
- core/actions/property_graph.ts (new)
- core/actions/property_graph_test.ts (new)
- core/BUILD

Porting the changes from PR (#2246)
rafal-hawrylak added a commit that referenced this pull request Aug 24, 2026
Builds on top of #2246 (PropertyGraph action class) and #2249 (review
follow-up). The class parsed and rendered a graph body but was not yet
loaded from user projects or exposed to downstream code.

- Session loading: main.ts finds `graph.yaml` files under `definitions/`
  and registers a PropertyGraph action per file. At most one graph.yaml
  is accepted per project.
- Action index: actions/index.ts and session.ts expose PropertyGraph so
  downstream code treats it like tables and operations.
- Emitter extensions: description and synonyms on both entities and
  relationships, fieldWildcard normalization for `fields: { importAll:
  true, except: [...] }`, and an OPTIONS clause on the graph carrying
  the graph description.
- Proto: adds `is_default` to GraphLabel for the label wiring above.
- Coverage: property_graph_test.ts grows for the new normalization and
  emitter behavior, and main_test.ts adds session-level tests plus a
  propertyGraph case in the shared test-helper switch.

Older `dataformCoreVersion` values silently skip PropertyGraph files so
projects pinning an earlier core do not break at load time.

Porting the changes from PR (#2251)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants