Substra / substra

Low-level Python library used to interact with a Substra network

Home Page:https://docs.substra.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle more gracefully adding the same testtuple twice

jeandut opened this issue · comments

Currently when adding the same testtuple twice the SDK raises the error:
substra.sdk.exceptions.AlreadyExists: Object with key(s) 'A' already exists.
Maybe one could catch the error and return a warning instead like: "testtupple already submitted " while returning the same dict the previous testtuple returned ?

To do that, you can use the option exist_ok=True when adding a testtuple (by default it's set to False). It will always return a testtuple even if it already exists. If it already exists a log warning will be emitted.

Ok closing it then !