Skip to content

feat: allow pass parameters to load_uri_to*#556

Merged
JoanFM merged 2 commits intomainfrom
fix-load-uri-to-blob
Sep 23, 2022
Merged

feat: allow pass parameters to load_uri_to*#556
JoanFM merged 2 commits intomainfrom
fix-load-uri-to-blob

Conversation

@JoanFM
Copy link
Copy Markdown
Member

@JoanFM JoanFM commented Sep 22, 2022

Goals:

Capture properly Exceptions from load_to_uri* methods and allow to pass extra keyword arguments as timeout

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 22, 2022

Codecov Report

Merging #556 (a4ad460) into main (4764cc7) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #556      +/-   ##
==========================================
- Coverage   86.41%   86.39%   -0.02%     
==========================================
  Files         142      134       -8     
  Lines        7139     6718     -421     
==========================================
- Hits         6169     5804     -365     
+ Misses        970      914      -56     
Flag Coverage Δ
docarray 86.39% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
docarray/document/mixins/blob.py 66.66% <100.00%> (ø)
docarray/document/mixins/helper.py 71.42% <100.00%> (+1.42%) ⬆️
docarray/document/mixins/image.py 59.76% <100.00%> (ø)
docarray/document/mixins/text.py 96.15% <100.00%> (ø)
docarray/document/__init__.py
docarray/array/storage/redis/__init__.py
docarray/__init__.py
docarray/base.py
docarray/array/__init__.py
docarray/array/mixins/__init__.py
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@JoanFM JoanFM force-pushed the fix-load-uri-to-blob branch from 24d86cc to adb3ce1 Compare September 22, 2022 20:58
Copy link
Copy Markdown

@TEChopra1000 TEChopra1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for the quick turn around! Do you think a try/exception statement would help with error handling? I.e. #549

@JoanFM
Copy link
Copy Markdown
Member Author

JoanFM commented Sep 22, 2022

This looks good. Thanks for the quick turn around! Do you think a try/exception statement would help with error handling? I.e. #549

Hey @TEChopra1000,

This should not affect, since the Exceptions should be directly raised.

@samsja
Copy link
Copy Markdown
Member

samsja commented Sep 23, 2022

What if someone want to change a parameters from another function that is called inside this one ?

In this pr we only assume that user would only want to change urllib.request.urlopen parameters but why not could he want to change req = urllib.request.Request as well for instance ?

@JoanFM
Copy link
Copy Markdown
Member Author

JoanFM commented Sep 23, 2022

What if someone want to change a parameters from another function that is called inside this one ?

In this pr we only assume that user would only want to change urllib.request.urlopen parameters but why not could he want to change req = urllib.request.Request as well for instance ?

Do you suggest simply to add timeout to _uri_to_blob but keep **kwargs in the API public functions?

@JoanFM JoanFM merged commit 6ee4500 into main Sep 23, 2022
@JoanFM JoanFM deleted the fix-load-uri-to-blob branch September 23, 2022 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pipeline hangs when using load_uri_to_image_tensor with large or error images

3 participants