Filter markdown metadata keys from app config to fix warnings#8300
Open
Mr-Neutr0n wants to merge 1 commit intomarimo-team:mainfrom
Open
Filter markdown metadata keys from app config to fix warnings#8300Mr-Neutr0n wants to merge 1 commit intomarimo-team:mainfrom
Mr-Neutr0n wants to merge 1 commit intomarimo-team:mainfrom
Conversation
Markdown frontmatter keys like author, description, and pyproject are valid metadata but not recognized by _AppConfig. Previously these were passed through to from_untrusted_dict which logged warnings for each unrecognized key. Instead of blindly forwarding all root element attributes, only include keys that are either explicitly mapped (e.g. title -> app_title) or are actual _AppConfig fields. This eliminates the spurious warnings when running markdown notebooks like the markdown-format tutorial. Fixes marimo-team#8259
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Contributor
|
Thanks for the contribution! looks like it conflicts with #8290, so ill defer to @dmadisetti on the approach |
Collaborator
|
I'm not sure this round trips, it should preserve the metadata on resave. Otherwise filtering it in one place is better |
Collaborator
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.

Summary
Running
marimo tutorial markdown-formatproduces spurious warnings about unrecognized keys (author,description,pyproject) in the app config. These are valid YAML frontmatter metadata keys that shouldn't be treated as app config entries.The root cause is in
app_config_from_root()which was forwarding all root element attributes into the app config dict. When_AppConfig.from_untrusted_dict()then receives these unknown keys, it logs a warning for each one.Fix
Instead of passing all attributes through and then trying to remove specific ones, I changed
app_config_from_root()to only include keys that are either:title→app_title)_AppConfigdataclass fieldsThis way, markdown-only metadata like
author,description,pyproject, andmarimo-versionare silently filtered out before they ever reach the config parser. The metadata is still available on the root element for other code paths that need it (e.g._tree_to_irreadsheaderandpyprojectdirectly viaroot.get()).Fixes #8259