Skip to content

Enumerate the load_errors sink in global_ids - #275

Merged
hbarthels merged 1 commit into
mainfrom
hb-global-ids-load-errors
Aug 22, 2026
Merged

Enumerate the load_errors sink in global_ids#275
hbarthels merged 1 commit into
mainfrom
hb-global-ids-load-errors

Conversation

@hbarthels

Copy link
Copy Markdown
Contributor

What changed

global_ids(data::Data) now reports the relation named by a (load_errors :name) clause of a generalized (relations …) csv_data declaration. The :csv_data branch in sdks/julia/LogicalQueryProtocol.jl/src/properties.jl collected target ids from whichever body group was set — PlainTargets.targets, or CDCTargets.inserts/deletes — and returned early, never reading csv_data.relations.load_errors.

The new id is pushed after the body loop, so the result keeps the order the declaration reads in and the existing unique collapses the case where the sink is also a regular target. The legacy (columns …) branch below it is untouched: there the sink is one of the columns already.

Why

The sink is a relation the declaration defines, and consumers key their declaration registries off global_ids. In raicode, reading the sink failed with KeyError: DependencyKey(_declaration, …) (raicode ff098a7d92e / RelationalAI/raicode#28117).

Tests

The global_ids testitem in test/properties_tests.jl gains six assertions: plain and CDC bodies, each without and with the clause, plus two edge cases — a sink that is also a target relation (reported once) and a TargetRelations carrying only load_errors with no body set. The CDC fixture shares a target between inserts and deletes, keeping the existing dedup covered.

The full Julia SDK suite passes: 174/174 test items, 34888 assertions, including the JET and Aqua checks.

Notes for reviewers

Julia-only. Neither the Python nor the Go SDK defines a global_ids equivalent, so no other SDK and no generated code needed a change.

🤖 Generated with Claude Code

The generalized `(relations ...)` form of a csv_data declaration collected target
ids from the body groups (`PlainTargets.targets`, or `CDCTargets.inserts`/`deletes`)
and returned early, so the relation named by a `(load_errors :name)` clause was
never reported. That sink is a relation the declaration defines, and consumers key
their declaration registries off `global_ids`; in raicode, reading the sink failed
with `KeyError: DependencyKey(_declaration, ...)`.

Push the sink's id after the body loop, so the result keeps the order the
declaration reads in and the existing `unique` collapses a sink that is also a
regular target. The legacy `(columns ...)` branch needs nothing — there the sink
is one of the columns already.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hbarthels
hbarthels marked this pull request as ready for review August 20, 2026 19:08
@hbarthels
hbarthels requested review from comnik and minsungc August 20, 2026 19:08
@hbarthels
hbarthels merged commit 88a9810 into main Aug 22, 2026
5 checks passed
@hbarthels
hbarthels deleted the hb-global-ids-load-errors branch August 22, 2026 22:58
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