Silence the 'surround' unknown-config-key warning for pre-#432 edits#457
Merged
Merged
Conversation
PR marcinz606#432 removed ExposureConfig.surround (dim-surround gamma, superseded by Snap), but every edit saved before that still carries the key in edits.db / sidecars, so from_flat_dict logged "Dropping unknown config keys: ['surround']" on every file load for upgrading users. Track deliberately-removed fields in a legacy set that drops silently; genuinely unknown keys keep the warning.
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.
Problem
After #432 removed
ExposureConfig.surround(dim-surround gamma, superseded by Snap), every edit saved before that merge still carries the key inedits.db/ sidecars.WorkspaceConfig.from_flat_dictnow logs on every file load for upgrading users:The key is correctly discarded — the warning is just noise, and it recurs until each edit happens to be re-saved.
Fix
Track deliberately-removed fields in a small
legacy_keysset that is dropped silently (with a comment noting what removed each key and when). Genuinely unknown keys keep the warning, so it still flags real corruption or version skew.Testing
Round-trip check: a config dict with
surroundloads with no warning; an actually-unknown key still warns.tests/test_config_deserialization.py(18 tests) passes; ruff clean.