pasqal-io / pasqal-cloud

Apache License 2.0
16 stars 1 forks source link

[FEAT] Retry job for an open batch #112

Closed Augustinio closed 7 months ago

Augustinio commented 8 months ago

Description

Remaining Tasks

Checklist

Versioning (PASQAL developers only)

Documentation

Tests

Internal tests pipeline (PASQAL developers only)

After updating the version (PASQAL developers only)

Augustinio commented 8 months ago

Functionality and code looks good.

I'm wondering if adding this as a Batch method is the best way to go about it though. Intuitively I would ave seen it as either a method on the SDK class (retry_job(job_id)) or on the job class retry(). Was there any reason to add it to the batch class?

I didn't go for the job class because we don't have access to the batch or sdk instance from the job instance. Hence we can't update the batches' ordered jobs from there. Going from the sdk would require to pass the batch as an argument anyway. Since this method makes use of the add_jobs method already used in batch I thought it simplest to have it there.