Skip to content

source.py: Make SourceInfo.serialize() a public API.#2016

Merged
gtristan merged 1 commit intomasterfrom
tristan/public-source-info-serialize
May 28, 2025
Merged

source.py: Make SourceInfo.serialize() a public API.#2016
gtristan merged 1 commit intomasterfrom
tristan/public-source-info-serialize

Conversation

@gtristan
Copy link
Contributor

This serializes the SourceInfo into a regular simple dictionary object that can be easily serialized into formats like json or yaml.

While it was requested to make this public in some way, it is not particularly useful to make this serialize directly into a yaml string, since normally one will probably want to serialize a list of SourceInfo objects reported for a given element, in whatever data structure one would want to serialize this into.

For this reason, we export the current serialization which just converts the SourceInfo object into something that other serialization python libraries can reliably consume (simple dictionaries).

This will output a normalized dictionary suitable for serialization
into formats like json or yaml.

Also updated caller in _frontend/widget.py.
Copy link

@shymega shymega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I think we're good with this one.

@gtristan gtristan merged commit a6b26ad into master May 28, 2025
17 checks passed
@gtristan gtristan deleted the tristan/public-source-info-serialize branch May 28, 2025 09:04
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.

3 participants