Skip to content

dumps

Dump models differ from their Read counterpart in that: * They are directly JSON-able, without any additional encoder. * They may include only a subset of the available fields.

These models are used in at least two situations: 1. In the "*_dump" attributes of Job models; 2. In the history items, to trim their size.

DatasetDumpV2

Bases: BaseModel

We do not include 'model_config = ConfigDict(extra="forbid")' because legacy data may include 'type_filters' or 'attribute_filters' and we want to avoid response-validation errors.

Source code in fractal_server/app/schemas/v2/dumps.py
66
67
68
69
70
71
72
73
74
75
76
77
class DatasetDumpV2(BaseModel):
    """
    We do not include 'model_config = ConfigDict(extra="forbid")' because
    legacy data may include 'type_filters' or 'attribute_filters' and we
    want to avoid response-validation errors.
    """

    id: int
    name: str
    project_id: int
    timestamp_created: str
    zarr_dir: str

WorkflowTaskDumpV2

Bases: BaseModel

We do not include 'model_config = ConfigDict(extra="forbid")' because legacy data may include 'input_filters' field and we want to avoid response-validation errors for the endpoints that GET datasets.

Source code in fractal_server/app/schemas/v2/dumps.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class WorkflowTaskDumpV2(BaseModel):
    """
    We do not include 'model_config = ConfigDict(extra="forbid")'
    because legacy data may include 'input_filters' field and we want to avoid
    response-validation errors for the endpoints that GET datasets.
    """

    id: int
    workflow_id: int
    order: Optional[int] = None

    type_filters: dict[str, bool]

    task_id: Optional[int] = None
    task: Optional[TaskDumpV2] = None