Skip to content

Conversation

@lpatino10
Copy link
Contributor

Fixes #826

The Discovery service has moved to using NLU-based enrichment options. This PR makes those corresponding model changes.

Copy link

@mkistler mkistler left a comment

Choose a reason for hiding this comment

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

I think we want builders for all the new models.

features.setEntities(entities);
features.setKeywords(keywords);
features.setSemanticRoles(semanticRoles);
EnrichmentOptions options = new EnrichmentOptions();

Choose a reason for hiding this comment

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

I think we probably want builders generated for EnrichmentOptions, NluEnrichmentFeatures, NluEnrichmentSemanticRoles, NluEnrichmentKeywords, NluEnrichmentEntities, NluEnrichmentEmotion, and NluEnrichmentSentiment.

Copy link
Contributor Author

@lpatino10 lpatino10 Dec 12, 2017

Choose a reason for hiding this comment

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

Agreed. I'll look at making that change in the swagger and updating this.

@codecov-io
Copy link

codecov-io commented Dec 14, 2017

Codecov Report

Merging #834 into develop will decrease coverage by 0.24%.
The diff coverage is 42.64%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #834      +/-   ##
=============================================
- Coverage      56.42%   56.17%   -0.25%     
  Complexity      2201     2201              
=============================================
  Files            488      496       +8     
  Lines          11832    12014     +182     
  Branches         672      674       +2     
=============================================
+ Hits            6676     6749      +73     
- Misses          4770     4879     +109     
  Partials         386      386
Impacted Files Coverage Δ Complexity Δ
...developer_cloud/discovery/v1/model/Enrichment.java 68.18% <ø> (ø) 8 <0> (ø) ⬇️
...ud/discovery/v1/model/NluEnrichmentCategories.java 0% <0%> (ø) 0 <0> (?)
...oud/discovery/v1/model/NluEnrichmentRelations.java 0% <0%> (ø) 0 <0> (?)
...cloud/discovery/v1/model/NluEnrichmentEmotion.java 39.13% <39.13%> (ø) 1 <1> (?)
...oud/discovery/v1/model/NluEnrichmentSentiment.java 39.13% <39.13%> (ø) 1 <1> (?)
...loud/discovery/v1/model/NluEnrichmentEntities.java 41.86% <41.86%> (ø) 1 <1> (?)
...discovery/v1/model/NluEnrichmentSemanticRoles.java 43.47% <43.47%> (ø) 1 <1> (?)
...loud/discovery/v1/model/NluEnrichmentFeatures.java 51.16% <51.16%> (ø) 1 <1> (?)
...loud/discovery/v1/model/NluEnrichmentKeywords.java 52.17% <52.17%> (ø) 1 <1> (?)
...er_cloud/discovery/v1/model/EnrichmentOptions.java 61.53% <58.33%> (-8.03%) 1 <1> (-7)
... and 9 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 ca526cf...dbc923f. Read the comment docs.

@germanattanasio
Copy link
Contributor

I think this is going to break existing users. 🔥

@lpatino10
Copy link
Contributor Author

Unfortunately I think so too 😞

Copy link

@mkistler mkistler left a comment

Choose a reason for hiding this comment

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

Looks good. Two small changes needed, but I have approved to avoid the delay of another review.

* @param targets the new targets
* @return the NluEnrichmentEmotion builder
*/
public Builder addTargets(String targets) {

Choose a reason for hiding this comment

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

We need "x-item-name": "target" on this array so that we get

public Builder addTarget(String target) {

We could probably make this change by hand here, rather than regenerate the whole SDK -- as long as we make sure to fix the swagger for future iterations.

* @param targets the new targets
* @return the NluEnrichmentSentiment builder
*/
public Builder addTargets(String targets) {

Choose a reason for hiding this comment

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

We need "x-item-name": "target" on this array so that we get

public Builder addTarget(String target) {

We could probably make this change by hand here, rather than regenerate the whole SDK -- as long as we make sure to fix the swagger for future iterations.

@lpatino10 lpatino10 merged commit 3d3abc3 into develop Dec 15, 2017
@germanattanasio germanattanasio deleted the discovery-patch branch February 1, 2018 03:11
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.

5 participants