Open maingoh opened 5 years ago
Related: http requests one-time inputs vs retry on error: need more control, even after #94:
for reference, after meeting with hugo and some tests:
files
accepts non-streamable too, the real constraint is: if it's streamable and non seekable, then we cannot support retries: raise error on second try (maybe on first too?)
isinstance(file, io.IOBase)
is not enough: raw iterators work too, notably Django Files: https://docs.djangoproject.com/en/3.1/_modules/django/core/files/base/#Filedata
accepts generator/iterator, or a dict (one level) of such thing: hard to check all that for now. maybe types constraints will help._Originally posted by @thomas-riccardi in https://github.com/Deepomatic/deepomatic-client-python/pull/94#discussion_r547376894_
Currently if the field of the files dict is a string and exists on the disk we try to open it and send the file. It is probably to much magic, and may conflict if a value we want to send is by chance the same as a file on the disk. We should let the user open the file. Note that this may break some users (hopefully they don't use the feature).