Repository navigation
feat(engine): classify data-loss notices #2467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Mavrick-F
merged 2 commits into
opengeos:main
from
Mavrick-F:feat/classified-loss-notices
Nov 19, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| //! Shared classification for data-loss notices, independent of their wording. | ||
|
|
||
| /// What happened to the data. | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | ||
| pub enum LossKind { | ||
| Dropped, | ||
| Changed, | ||
| Approximated, | ||
| Assumed, | ||
| } | ||
|
|
||
| impl LossKind { | ||
| /// A language-independent name for this kind of loss. | ||
| pub const fn id(self) -> &'static str { | ||
| match self { | ||
| Self::Dropped => "dropped", | ||
| Self::Changed => "changed", | ||
| Self::Approximated => "approximated", | ||
| Self::Assumed => "assumed", | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// The specific cause of a loss. Add causes here so producers use the same code for the same loss. | ||
| #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | ||
| #[non_exhaustive] | ||
| pub enum LossCode { | ||
| DroppedLegend, | ||
| DroppedTime, | ||
| DroppedValue, | ||
| DroppedCalculationResult, | ||
| ChangedTruncated, | ||
| } | ||
|
|
||
| /// A code's identifier, effect on the data, and what the user can do about it. | ||
| pub struct LossSpec { | ||
| pub id: &'static str, | ||
| pub kind: LossKind, | ||
| pub action: &'static str, | ||
| } | ||
|
|
||
| impl LossCode { | ||
| /// The registry entry that supplies the untranslated identifier and remediation. | ||
| pub const fn spec(self) -> LossSpec { | ||
| use LossKind::{Changed, Dropped}; | ||
| let (id, kind, action) = match self { | ||
| Self::DroppedLegend => ("dropped.legend", Dropped, "Use a service with short HTTP or HTTPS addresses for its legend pictures."), | ||
| Self::DroppedTime => ("dropped.time", Dropped, "Write to a date-time field to keep the time of day."), | ||
| Self::DroppedValue => ("dropped.value", Dropped, "Correct the value or use a destination field that can hold it."), | ||
| Self::DroppedCalculationResult => { | ||
| ("dropped.calculation-result", Dropped, "Correct the expression or check the input rows named in the notice.") | ||
| } | ||
| Self::ChangedTruncated => ("changed.truncated", Changed, "Use a decimal field to keep the fractional part."), | ||
| }; | ||
| LossSpec { id, kind, action } | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classification is applied on one path only (medium confidence, probably a follow-up): the same loss categories are still published as unclassified
Infoelsewhere in this file and inclipboard.rs:cuts.notices("Paste", ...)and thens.notify(..., false), so pasted truncations and date-time losses lose their code and becomeInfo.new_rowand the per-cell notice (aroundedit.rs:282-295) report numeric truncation and "kept only its day" throughnotify_textasInfo, with no code.Cuts::classifiedalready has the same kinds.The PR says this first migration covers calculations, rules and legend images, so this may be intended. If so, name the remaining paths in the PR description and link them to #2371. Otherwise, the same loss gets a different severity depending on how the user entered the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first migration covers Calculate Field, attribute rules, and service legends. Paste, new-row defaults, and direct cell edits are part of the remaining producer migration in #2371. I’ve named those paths in the PR description.