Conversation
5 tasks
jsignell
commented
Feb 12, 2026
| data = super().to_dict() | ||
| data["href"] = self.href | ||
| return data | ||
| return {"href": self.href, **data} |
Member
Author
There was a problem hiding this comment.
Put the href first in the dict
| data["type"] = self.type | ||
| data["roles"] = self.roles | ||
| data["statistics"] = self.statistics.to_dict() or None | ||
| return {k: v for k, v in data.items() if v is not None} |
Member
Author
There was a problem hiding this comment.
I think the default behavior should be no null values in the output dict.
f3d2504 to
3adb93c
Compare
Member
Author
|
We could add some of these to collection and bands as well if you like the approach @gadomski |
gadomski
approved these changes
Mar 10, 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.
Related Issue(s):
Description:
Start on common metadata fields. I am not sure if these should be on all objects or just the ones they are most useful on.
The main benefit is the code completion powered by the static typing on the properties. Right now there is no validation on these setters, but there could be custom validation if needed.
An alternative to this would be to use a pydantic model but that has a few downsides:
extra_fieldsdict as the backing for these common fieldsPR Checklist:
pre-commit run --all-files)pytest)