Repository navigation
feat(config)!: drop legacy layouts and support marshmallow 3 - #132
Merged
Merged
Conversation
cwasicki
requested review from
Linus404 and
shsms
and removed request for
a team
September 1, 2026 06:38
It is already used transitively via marshmallow-dataclass, but was never declared, so the pytest_min job left it free to resolve to marshmallow 4. Declaring it pins the lower bound there, so the minimum-version path is tested. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
tomllib parses TOML datetimes to native datetime objects, which marshmallow 3's DateTime field rejects; marshmallow 4 accepts them. A TomlAwareDateTime field passes an already-parsed datetime through and otherwise defers to the parent for ISO strings, applied to every bare datetime config field sourced from TOML. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
The top-level microgrid-ID and `meta`-nested layouts are no longer migrated on load. A file with no `assets` table now loads as empty and contributes nothing to a merge, so a mixed list of files (some with an `[app]` table, some with `assets`) can be passed to the loaders and only the `assets`-bearing ones are read. `_STEPS` is now empty; the version validation and stamping remain. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
phillip-wenig-frequenz
previously approved these changes
Sep 1, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 1, 2026
Dump and patch flattened the config via `Schema.dump`, whose field order is not stable across marshmallow versions: marshmallow 3 does not preserve declaration order, so the generated dotted keys came out reordered under the pinned minimum. Use `dataclasses.asdict`, which always yields declaration order, dropping marshmallow from this path. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com>
Collaborator
Author
|
Added another fix to pass the minimum pytest. |
cwasicki
enabled auto-merge
September 1, 2026 09:19
phillip-wenig-frequenz
approved these changes
Sep 1, 2026
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.
Dropping the legacy microgrid config layouts (breaking) and fixing config loading under marshmallow 3.
Breaking change
The top-level microgrid-ID and
meta-nested layouts are no longer migrated on load. A file with noassetstable now loads as empty and contributes nothing to a merge, instead of having its top-level keys read as microgrid IDs. This lets a mixed list of files (some carrying an[app]table for their own config, some anassetstable) be passed toAssetsConfig.load_from_files/load_configs, which reads only theassets-bearing ones. Rebuild any legacy-layout files withgenerate-config._STEPSis now empty;assets.versionvalidation and stamping remain.Bug fix
tomllibparses TOML datetimes to nativedatetimeobjects, which marshmallow 3'sDateTimefield rejected (marshmallow 4 accepts them). ATomlAwareDateTimefield passes an already-parseddatetimethrough and otherwise defers to the parent for ISO strings, applied to every bare datetime config field sourced from TOML.Build
Now declares
marshmallowas a direct dependency. It was already used transitively viamarshmallow-dataclassbut never declared, so the minimum-version job left it free to resolve to marshmallow 4. Declaring it pins the lower bound so the marshmallow-3 path is tested.