Enumerate the load_errors sink in global_ids - #275
Merged
Conversation
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
marked this pull request as ready for review
August 20, 2026 19:08
comnik
approved these changes
Aug 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_databranch insdks/julia/LogicalQueryProtocol.jl/src/properties.jlcollected target ids from whichever body group was set —PlainTargets.targets, orCDCTargets.inserts/deletes— and returned early, never readingcsv_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
uniquecollapses 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 withKeyError: DependencyKey(_declaration, …)(raicode ff098a7d92e / RelationalAI/raicode#28117).Tests
The
global_idstestitem intest/properties_tests.jlgains 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 aTargetRelationscarrying onlyload_errorswith no body set. The CDC fixture shares a target betweeninsertsanddeletes, 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_idsequivalent, so no other SDK and no generated code needed a change.🤖 Generated with Claude Code