SerializedDatasetRef¶
- class lsst.daf.butler.SerializedDatasetRef(*, id: UUID, datasetType: SerializedDatasetType | None = None, dataId: SerializedDataCoordinate | None = None, run: str | None = None, component: str | None = None)¶
Bases:
BaseModel
Simplified model of a
DatasetRef
suitable for serialization.Attributes Summary
A dictionary of computed field names and their corresponding
ComputedFieldInfo
objects.Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].Metadata about the fields defined on the model, mapping of field names to [
FieldInfo
][pydantic.fields.FieldInfo].Methods Summary
direct
(*, id, run[, datasetType, dataId, ...])Construct a
SerializedDatasetRef
directly without validators.Attributes Documentation
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding
ComputedFieldInfo
objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'component': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, default=None), 'dataId': FieldInfo(annotation=Union[SerializedDataCoordinate, NoneType], required=False, default=None), 'datasetType': FieldInfo(annotation=Union[SerializedDatasetType, NoneType], required=False, default=None), 'id': FieldInfo(annotation=UUID, required=True), 'run': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [
FieldInfo
][pydantic.fields.FieldInfo].This replaces
Model.__fields__
from Pydantic V1.
Methods Documentation
- classmethod direct(*, id: str, run: str, datasetType: dict[str, Any] | None = None, dataId: dict[str, Any] | None = None, component: str | None = None) SerializedDatasetRef ¶
Construct a
SerializedDatasetRef
directly without validators.- Parameters:
- id
str
The UUID in string form.
- run
str
The run for this dataset.
- datasetType
dict
[str
,typing.Any
] A representation of the dataset type.
- dataId
dict
[str
,typing.Any
] A representation of the data ID.
- component
str
orNone
Any component associated with this ref.
- id
- Returns:
- serialized
SerializedDatasetRef
A Pydantic model representing the given parameters.
- serialized
Notes
This differs from the pydantic “construct” method in that the arguments are explicitly what the model requires, and it will recurse through members, constructing them from their corresponding
direct
methods.The
id
parameter is a string representation of dataset ID, it is converted to UUID by this method.This method should only be called when the inputs are trusted.