in annotation/annotation/schemas/jobs.py [0:0]
def check_files_datasets_previous_jobs(cls, values):
"""
Files and datasets and revisions should not be empty at the same time.
"""
files, datasets = values.get("files"), values.get("datasets")
revisions = values.get("revisions")
previous_jobs = values.get("previous_jobs")
job_type = values.get("job_type")
if (
not (bool(previous_jobs) ^ bool(files or datasets or revisions))
and job_type != JobTypeEnumSchema.ImportJob
):
raise ValueError(
"Only one field must be specified: "
"either previous_jobs or files/datasets/revisions"
)
return values