from apiflask import Schema, fields
from apiflask.validators import Range


class DatasetUploadDto(Schema):
    dataset = fields.File(attribute="dataset", required=True)


class DatasetDto(Schema):
    input = fields.List(fields.String(), load_default=None)
    target = fields.String(required=True)
    sep = fields.String(load_default=",")
    decimal = fields.String(load_default=".")
    train_volume = fields.Float(load_default=0.8, validate=Range(min=0.1, max=0.9))
