Skip to content

Stop 'Dropping unknown config keys: stitch_*' warning on load#594

Open
linkmodo wants to merge 1 commit into
marcinz606:mainfrom
linkmodo:fix/stitch-config-keys-warning
Open

Stop 'Dropping unknown config keys: stitch_*' warning on load#594
linkmodo wants to merge 1 commit into
marcinz606:mainfrom
linkmodo:fix/stitch-config-keys-warning

Conversation

@linkmodo

Copy link
Copy Markdown
Contributor

Summary

Every load of a serialized edit logs:

WARNING negpy.domain.models: Dropping unknown config keys: ['stitch_canvas', 'stitch_enabled', 'stitch_paths', 'stitch_sizes', 'stitch_transforms']

WorkspaceConfig.to_dict() serializes the StitchConfig fields (res.update(asdict(self.stitch))) and from_flat_dict()'s _build_stitch() reconstructs them — but StitchConfig was missing from the config_classes list that builds the known-keys set. So the stitch keys were treated as unknown and warned about on every load, despite being consumed correctly. The stitch config itself round-tripped fine; only the spurious warning was the problem.

Fix: add StitchConfig to that known-keys list.

Test plan

  • tests/test_config_deserialization.py:
    • test_stitch_keys_do_not_warn — asserts no warning when loading a freshly serialized config (fails on main with the exact stitch-keys message; passes with the fix).
    • test_stitch_config_round_trips — a stitch-enabled config survives to_dict/from_flat_dict with fields intact and stays hashable.
  • Full test_config_deserialization.py passes (28 tests); ruff check + ruff format clean.

WorkspaceConfig.to_dict() serializes the StitchConfig fields, and
_build_stitch() reconstructs them, but StitchConfig was absent from the
known-keys set in from_flat_dict(), so stitch_* keys were flagged as
unknown and logged "Dropping unknown config keys" on every load of a
stitched (or freshly-serialized) edit. Add StitchConfig to that set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant