Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 create or update a document from an InputStream and optionally … #630

Merged

Conversation

tdumitriu
Copy link
Contributor

…specify a filename

Fixes #672

Summary

Some users submit documents to the Discovery service through the provided SDK, but they do not want to use Files directly. (They may load the file into memory and simply pass the bytes as an InputStream.) In these cases, the name of the file is not available or automatically added as a parameter to the file section of the multi-part request. Because of this the ingestion fails since this process doesn't accept input streams without a file name.
With this commit we fix this issue (when only the InputStream is provided) by setting a generic filename. We also provide a mechanism for the user to be able to provide / specify the file name for these requests.

Other Information

Thanks for contributing to the Watson Developer Cloud!

@CLAassistant
Copy link

CLAassistant commented Mar 31, 2017

CLA assistant check
All committers have signed the CLA.

@codecov-io
Copy link

codecov-io commented Mar 31, 2017

Codecov Report

Merging #630 into develop will decrease coverage by 12.83%.
The diff coverage is 80%.

Impacted file tree graph

@@              Coverage Diff               @@
##             develop     #630       +/-   ##
==============================================
- Coverage      60.11%   47.27%   -12.84%     
+ Complexity      1559     1131      -428     
==============================================
  Files            337      337               
  Lines           6908     6927       +19     
  Branches         429      430        +1     
==============================================
- Hits            4153     3275      -878     
- Misses          2433     3373      +940     
+ Partials         322      279       -43
Impacted Files Coverage Δ Complexity Δ
...watson/developer_cloud/discovery/v1/Discovery.java 89.89% <ø> (-0.06%) 29 <0> (ø)
...overy/v1/model/document/CreateDocumentRequest.java 84.9% <80%> (+12.17%) 7 <0> (ø) ⬇️
...veloper_cloud/text_to_speech/v1/model/Phoneme.java 0% <0%> (-100%) 0% <0%> (-3%)
...oper_cloud/alchemy/v1/model/LanguageSelection.java 0% <0%> (-100%) 0% <0%> (-1%)
...on/developer_cloud/alchemy/v1/AlchemyDataNews.java 0% <0%> (-91.67%) 0% <0%> (-5%)
...deoff_analytics/v1/model/column/NumericColumn.java 20% <0%> (-80%) 1% <0%> (-4%)
...atson/developer_cloud/dialog/v1/DialogService.java 0% <0%> (-76.24%) 0% <0%> (-23%)
...cloud/dialog/v1/model/ConversationDataOptions.java 0% <0%> (-75.76%) 0% <0%> (-6%)
...tson/developer_cloud/alchemy/v1/AlchemyVision.java 0% <0%> (-75.72%) 0% <0%> (-14%)
...eloper_cloud/alchemy/v1/util/AlchemyEndPoints.java 0% <0%> (-71.88%) 0% <0%> (-5%)
... and 144 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77f6a21...30dfb6a. Read the comment docs.

@germanattanasio germanattanasio merged commit 8357064 into watson-developer-cloud:develop Apr 2, 2017
@tdumitriu tdumitriu deleted the fix_create_document branch April 3, 2017 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants