text
stringlengths 0
93.6k
|
---|
height: Quantity = Field(
|
repr_type="Quantity",
|
repr_kwargs={"unit_options": ["m", "cm", "mm", "ft", "in"], "decimalScale": 3, "n_cols": 1 / 3},
|
)
|
material: str = Field(repr_kwargs={"n_cols": 1 / 3})
|
color: str | None = Field(default=None, repr_type="Color", repr_kwargs={"n_cols": 1 / 3})
|
class WorkStation(BaseModel):
|
"""Work station model."""
|
has_desk: bool = Field(title="Has desk", repr_type="Chip")
|
has_monitor: bool = Field(title="Has monitor", repr_type="Switch")
|
desk: Desk | None = Field(
|
title="Desk",
|
default=None,
|
json_schema_extra={"repr_kwargs": {"visible": ("has_desk", "==", True)}},
|
)
|
room_temperature: Quantity = Field(
|
repr_type="Quantity",
|
repr_kwargs={"unit_options": {"C": "°C", "F": "°F"}},
|
default_factory=lambda: Quantity(24, "C"),
|
)
|
class HomeOffice(BaseModel):
|
"""Home office model."""
|
type: Literal["home_office"]
|
has_workstation: bool = Field(title="Has workstation", description="Does the employee have a suitable workstation")
|
workstation: WorkStation | None = Field(
|
title="Workstation",
|
default=None,
|
json_schema_extra={"repr_kwargs": {"visible": ("has_workstation", "==", True)}},
|
)
|
class WorkOffice(BaseModel):
|
"""Work office model."""
|
type: Literal["work_office"]
|
commute_time: int = Field(title="Commute time", ge=0, repr_kwargs={"suffix": " min"})
|
class Metadata(BaseModel):
|
"""Metadata model."""
|
languages: list[str] = Field(
|
title="Languages spoken",
|
default_factory=list,
|
json_schema_extra={
|
"repr_type": "ChipGroup",
|
"repr_kwargs": {"multiple": True, "orientation": "horizontal", "data_getter": "languages"},
|
},
|
)
|
siblings: int | None = Field(title="Siblings", default=None, ge=0)
|
location: HomeOffice | WorkOffice | None = Field(
|
title="Work location",
|
default=None,
|
discriminator="type",
|
repr_kwargs={
|
"fields_repr": {"type": fields.RadioItems(options_labels={"home_office": "Home", "work_office": "Work"})}
|
},
|
)
|
private_field: str | None = None
|
class Employee(BaseModel):
|
"""Employee model."""
|
name: str = Field(title="Name", description="Name of the employee", min_length=2)
|
age: int = Field(title="Age", description="Age of the employee, starting from their birth", ge=18)
|
mini_bio: str | None = Field(
|
title="Mini bio",
|
description="Short bio of the employee",
|
default=None,
|
json_schema_extra={"repr_type": "Markdown"},
|
)
|
joined: date = Field(title="Joined", description="Date when the employee joined the company", repr_type="Month")
|
office: Literal["au", "fr", "uk"] = Field(
|
title="Office",
|
description="Office of the employee",
|
json_schema_extra={
|
"repr_type": "RadioItems",
|
"repr_kwargs": {"options_labels": {"au": "Australia", "fr": "France", "uk": "United Kingdom"}},
|
},
|
)
|
resume_file: str | None = Field(
|
title="Resume file path",
|
repr_type="Path",
|
repr_kwargs={
|
"backend": "gs",
|
"prefix": "gs://ecmwf-open-data",
|
"path_type": "directory",
|
"n_cols": 1.0,
|
"value_includes_prefix": True,
|
},
|
default=None,
|
)
|
metadata: Metadata | None = Field(title="Employee metadata", default=None)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.