GoogleCloudPlatform / GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK

adk-2.0 producer: enrich rows with attributes.adk.node (path, run_id, parent_path)

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
47
Forks
21
Avg merge
2d 13h
Merged PRs (30d)
33

Description

Parent tracker: #190 (v15 contract).
Wave: 2 — Producer event rows.
Blocked by: #194 (EventData source-event plumbing), #195 (identity stamping).

## Contract

Serialize `attributes.adk.node` on every originating-Event row from `_log_event`:

- `node.path` — raw, may be `""` for non-workflow events (`src/google/adk/events/event.py:45`).
- `node.run_id` — the path-derived `@property` value from `NodeInfo` (`event.py:67`). Must be serialized explicitly, not relied on as a stored field.
- **`node.parent_path`** — the **canonical DAG join key**. Producer-computed:
- If `node.path` contains `/`, strip the trailing `/@`.
- If `node.path` is bare (`name@1`) or empty, emit JSON `null` — this is the single canonical "no parent" form. **Do not emit `""`.**
- `node.parent_run_id` — optional debug convenience only. **Consumer views must not join on this** — run ids are only unique within a single segment, so two different parent nodes can share `parent_run_id`.
- `node.output_for`, `node.message_as_output` — pass through if present.

## Acceptance

- [ ] Every originating-Event row carries `attributes.adk.node.{path, run_id, parent_path}`.
- [ ] `parent_path` is JSON `null` (not `""`) for bare paths (`name@1`) and empty paths.
- [ ] `parent_path = "wf/A@1"` for `path = "wf/A@1/B@2"` (strip-trailing test).
- [ ] Non-Event-originating rows leave `attributes.adk.node` null (best-effort).

## References

- #190 (v15 producer §1; v6 `parent_path` rationale).
- `src/google/adk/events/event.py:35` (`NodeInfo`), `:45` (path default), `:67-80` (run_id / parent_run_id computed properties).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.