-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
because BaseModel.model_dump takes parameters that alter its return type, it can't really be statically typed, at least in the current version of the python type system. For zarr in particular it would be useful to have something like model_dump that doesn't take any parameters and returns a dict that is a valid metadata document, with a well-defined type. Such a method would relieve the need to define special serialization rules in model_dump or via field serializer logic (like omitting dimension_names if the value is None).
One complication here is that for zarr v2, there are 2 metadata documents: .zgroup / .zarray, and .zattrs. I'm not sure how much that should matter for this method, though.
Metadata
Metadata
Assignees
Labels
No labels