epam / badgerdoc

Apache License 2.0
31 stars 32 forks source link

feat: add `previous_jobs` support for starting new pipelines #853

Closed SunnyCapt closed 3 months ago

SunnyCapt commented 3 months ago

close #848

khyurri commented 3 months ago

@SunnyCapt

I tried to send request with files selected:

{
    "name": "Test Job",
    "files": [
        349
    ],
    "datasets": [],
    "type": "ExtractionJob",
    "is_draft": false,
    "is_auto_distribution": false,
    "start_manual_job_automatically": false,
    "categories": [],
    "owners": [
        "0dc326e4-b190-4881-8d05-12359052abbf"
    ],
    "annotators": [],
    "validators": [],
    "pipeline_name": "contract_terms_extract",
    "pipeline_id": "contract_terms_extract",
    "pipeline_engine": "airflow"
}

And got response:

{
    "detail": [
        {
            "loc": [
                "body",
                "files"
            ],
            "msg": "unsupported operand type(s) for ^: 'NoneType' and 'NoneType'",
            "type": "type_error"
        },
        {
            "loc": [
                "body",
                "datasets"
            ],
            "msg": "files and datasets cannot be empty at the same time",
            "type": "value_error"
        },
        {
            "loc": [
                "body",
                "previous_jobs"
            ],
            "msg": "unsupported operand type(s) for ^: 'NoneType' and 'NoneType'",
            "type": "type_error"
        }
    ]
}

I think we have 2 problems here:

  1. None type must be checked before ^ operation
  2. User can send or files, datasets or previous_jobs