You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sources): mark tags_as_data as provisional - #657
This PR carries out the developer's decision on ITL-1020 (BL27): tags_as_data is kept, and it is provisional in 0.4.0: its behaviour and identity may change, or it may be removed, in a later version. Using it warns once per process on each route that takes it (DerivedSource, node.as_source(), SpiralDBTableSource); a saved job that uses it warns when it is loaded; and no frozen golden value depends on it (its golden entries are already in the provisional files, ITL-1331). The docs state the preferred route: when in doubt, start with the column as a data-tag (or at least as data) at the source, and promote it later if needed. How to promote a plain tag properly is a separate design issue, ITL-1694.
What changes for a user
The first use of a non-empty tags_as_data mapping in a process issues ProvisionalHashWarning, once for each route: DerivedSource(..., tags_as_data=...), node.as_source(tags_as_data=...) (one warning shared by function and operator nodes) and SpiralDBTableSource(..., tags_as_data=...). An empty mapping does not warn. This warning is separate from the existing DerivedSource identity warning.
Loading a saved job whose source config holds a non-empty tags_as_data mapping warns for that route, also when the slot stays unbound. The warning honours a filter that turns it into an error.
Docs: a "Provisional" admonition beside every description of tags_as_data (docs/concepts/sources.md, data-tags.md, operators.md, identity.md, docs/reference/hashing.md, golden-hashes.md) and in the docstrings, so the generated API reference (Sources, Nodes, Operators, Errors) shows it. Each says the argument may change or be removed and gives the preferred route: start with a data-tag at the source, or start with data and promote it to a data-tag if needed.
CLAUDE.md / .zed/rules, the changelog fragment changelog.d/ITL-1020.md and design issue ITL-1020-TAD1 (resolved) record the decision.
Found by review, fixed here
Finding
Fix
Test
Loading a saved job with a tags_as_data source whose slot stays unbound gave no tags_as_data warning (only the DerivedSource identity warning).
pipeline/serialization.py warns for a non-empty mapping in the saved source config, whether or not the slot is rebound.
Found in review, present on main, not addressed here
ITL-1695: a saved job whose slot is bound to node.as_source(tags_as_data=..., source_id=...), or to a tag-copy DerivedSource over an in-memory Arrow table, loads with that slot unbound. This PR only makes that load warn; rebinding is ITL-1695 (the plain node.as_source() form is ITL-956).
Follow-up
ITL-1694: design for promoting a tag to a data-tag or data column properly, and whether tags_as_data then stays, changes or goes.
Verification
CI on head 162d38a is green: Tests (3.13), Specification tests (3.13), PostgreSQL tests (3.13), Ruff and basedpyright, Build the site, Dependency review, license check.
Independent review: READY. CodeRabbit: no open items.
No actionable comments were generated in the recent review.
Walkthrough
The change marks tags_as_data as provisional, adds a once-per-process warning for non-empty mappings, and updates code and project documentation with the warning behavior and usage guidance.
Changes: Provisional tags_as_data status
Layer / File(s)
Summary
Warning helper and identity recording src/orcapod/utils/provisional.py, src/orcapod/core/sources/provisional.py, src/orcapod/errors.py
The warning utility can skip recording a provisional identity. A helper uses this option to warn about tags_as_data.
Source warnings and validation src/orcapod/core/sources/derived_source.py, src/orcapod/core/sources/spiraldb_table_source.py, tests/test_core/sources/*
Both source constructors warn when tags_as_data is non-empty. Tests check warning behavior, including empty mappings and identity recording.
Provisional status and usage guidance .zed/rules, CLAUDE.md, changelog.d/*, docs/concepts/*, docs/dev/design_issues/*, docs/reference/*, src/orcapod/core/nodes/*
The documentation and docstrings describe tags_as_data as provisional, note it may change or be removed, and provide usage guidance.
This change marks tags_as_data as provisional and adds a once-per-process warning when it is used with a non-empty mapping. Behavior is otherwise unchanged and empty mappings stay silent. No merge-blocking risk was identified.
Security architecture risk: Minimal · up to f22e1
Non-empty tag-copy mappings still work, but they now trigger a provisional-feature warning. Applications that treat this warning as an error can reject affected source construction or job loading. The reviewed change does not expand data access or require a migration.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The added warning path is reachable through existing constructors with a non-empty mapping. Its direct effect is process-local: the helper receives neither mapping contents nor project, table, or credential information, and it grants no new data access.
Resilience and Maintainability Implications
inferred — The existing lock and recheck serialize concurrent first use. If warning emission raises or is interrupted before the name is recorded, the next use can warn again. A reentrant warning hook can also enter before that record is written. This state controls warning delivery, not identity or access.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(sources): mark tags_as_data as provisional" states the main change. The changeset marks the tags_as_data argument as provisional across DerivedSource, SpiralDBTableSource, and related …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "feat(sources): mark tags_as_data as provisional" states the main change. The changeset marks the tags_as_data argument as provisional across DerivedSource, SpiralDBTableSource, and related docs. It also adds a once-per-process warning for non-empty mappings and changes warn_provisional_use. The title does not mention the new warning, but it covers the primary intent. The title is concise and specific.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
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
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.
Fixes ITL-1020
Summary
This PR carries out the developer's decision on ITL-1020 (BL27):
tags_as_datais kept, and it is provisional in 0.4.0: its behaviour and identity may change, or it may be removed, in a later version. Using it warns once per process on each route that takes it (DerivedSource,node.as_source(),SpiralDBTableSource); a saved job that uses it warns when it is loaded; and no frozen golden value depends on it (its golden entries are already in the provisional files, ITL-1331). The docs state the preferred route: when in doubt, start with the column as a data-tag (or at least as data) at the source, and promote it later if needed. How to promote a plain tag properly is a separate design issue, ITL-1694.What changes for a user
tags_as_datamapping in a process issuesProvisionalHashWarning, once for each route:DerivedSource(..., tags_as_data=...),node.as_source(tags_as_data=...)(one warning shared by function and operator nodes) andSpiralDBTableSource(..., tags_as_data=...). An empty mapping does not warn. This warning is separate from the existingDerivedSourceidentity warning.tags_as_datamapping warns for that route, also when the slot stays unbound. The warning honours a filter that turns it into an error.tags_as_data(docs/concepts/sources.md,data-tags.md,operators.md,identity.md,docs/reference/hashing.md,golden-hashes.md) and in the docstrings, so the generated API reference (Sources, Nodes, Operators, Errors) shows it. Each says the argument may change or be removed and gives the preferred route: start with a data-tag at the source, or start with data and promote it to a data-tag if needed.CLAUDE.md/.zed/rules, the changelog fragmentchangelog.d/ITL-1020.mdand design issueITL-1020-TAD1(resolved) record the decision.Found by review, fixed here
tags_as_datasource whose slot stays unbound gave notags_as_datawarning (only theDerivedSourceidentity warning).pipeline/serialization.pywarns for a non-empty mapping in the saved source config, whether or not the slot is rebound.test_provisional_sources.py::test_a_loaded_job_over_an_unbound_derived_source_warns,::test_loading_an_unbound_job_honors_the_tags_as_data_error_filtertests/test_docs/test_site_content.py::test_the_documentation_builds(counts the notices per page)node.as_source()key, and a loaded node-backed config uses it too.test_spiraldb_table_source_tags_as_data.py::test_only_nonempty_mappings_warn_once_per_route,test_provisional_sources.py::test_an_empty_mapping_does_not_warn_about_tags_as_dataFound in review, present on
main, not addressed herenode.as_source(tags_as_data=..., source_id=...), or to a tag-copyDerivedSourceover an in-memory Arrow table, loads with that slot unbound. This PR only makes that load warn; rebinding is ITL-1695 (the plainnode.as_source()form is ITL-956).Follow-up
tags_as_datathen stays, changes or goes.Verification
🤖 Generated with Claude Code