Repository navigation
feat(dataset): walk every annotation owner and list all keys in the schema - #812
Merged
masquare merged 7 commits intoNov 20, 2026
Merged
Conversation
masquare
marked this pull request as ready for review
November 19, 2026 05:45
masquare
force-pushed
the
feature/annotation-owner-walk
branch
from
November 19, 2026 16:17
f1eff3f to
7ce78ef
Compare
masquare
changed the base branch from
main
to
feature/connector-api-ergonomics
November 19, 2026 16:18
masquare
force-pushed
the
feature/annotation-owner-walk
branch
from
November 19, 2026 17:34
7ce78ef to
aedf8ac
Compare
✅ CI checks passed
Updated for |
masquare
force-pushed
the
feature/annotation-owner-walk
branch
from
November 19, 2026 17:48
aedf8ac to
27fb02d
Compare
karhu
approved these changes
Nov 19, 2026
karhu
left a comment
Contributor
There was a problem hiding this comment.
PR description looks out-of-date, otherwise LGTM
…chema Add annotation_owners() to Record, Task and the dataset. The dataset yields itself, then each Record with its Sources and Signals, then each task. walk_annotations() on Record, Task and the dataset goes through it, and every owner gets annotation(key), which returns the first annotation with a key. derive_schema and describe read every owner through the walk, so the schema now also lists the annotation keys of the dataset and of tasks. The keys of streamed tasks are added while the writer streams them, and a key with conflicting descriptors raises before the manifest is written.
TimeFDataset.annotation_owners() had no caller apart from walk_annotations(). walk_annotations() now yields the dataset occurrences, then those of each Record, then those of each task. Record and Task keep annotation_owners(), which the load plan uses.
The name says what the method gives: the entities of a Record or a task that can carry annotations.
Record.annotatable_entities() had no caller apart from Record.walk_annotations(), so it is gone and walk_annotations() walks the Sources and Signals itself again. Task keeps annotatable_entities(), because a task class can hold another annotatable entity.
Nothing in the source needs a lookup by key. Callers read the annotations directly.
Task.annotatable_entities() only yielded the task. walk_annotations() now returns the task's annotations, and a task class that holds another annotated object can add its occurrences there.
masquare
force-pushed
the
feature/annotation-owner-walk
branch
from
November 20, 2026 07:25
27fb02d to
d4a95de
Compare
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.
Add one generic walk over every object that can hold annotations, and use it everywhere the code reads annotations of the whole dataset.
What changes
annotatable_entities()on Task yields the entities of a task that can carry annotations. A plain task yields itself, and a task class that holds another annotatable entity yields that entity too.walk_annotations()on Record, Task and the dataset yields their annotation occurrences. The dataset yields its own, then those of each Record, then those of each task.annotation(key), which returns the first annotation with a key.derive_schemaanddescriberead every owner through the walk.Behaviour change
The schema now also lists the annotation keys of the dataset and of tasks, not only those of Records, Sources and Signals. A key with conflicting descriptors on two owners now raises an error. For a streamed dataset, the writer adds the keys of the streamed tasks while it streams them. It raises on a conflict before the manifest is written.
This PR does not change label sets. The next PR in the stack makes a label set an annotation owner through this walk.
Checks
make checkandmake test-connectorspass.