Data validation using Python type hints
90
{
"context": "This criteria evaluates how well the engineer uses Pydantic's ByteSize type to implement storage quota validation and management. The focus is on proper usage of ByteSize for parsing human-readable sizes, comparing sizes, and formatting output.",
"type": "weighted_checklist",
"checklist": [
{
"name": "ByteSize field usage",
"description": "Uses ByteSize type from pydantic.types or pydantic for the quota_limit field in the StorageQuota model",
"max_score": 30
},
{
"name": "Size comparison",
"description": "Correctly compares file sizes in bytes with the ByteSize quota_limit (e.g., by comparing with the ByteSize value directly or converting to bytes)",
"max_score": 25
},
{
"name": "Human-readable formatting",
"description": "Uses ByteSize.human_readable() method or equivalent to format byte sizes as human-readable strings",
"max_score": 25
},
{
"name": "Unit handling",
"description": "Correctly handles both decimal (KB, MB, GB) and binary (KiB, MiB, GiB) units in parsing and formatting",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-pydanticdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10