diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d76637..62d688d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# unreleased +- Fix a bug where some label annotations cannot be applied + # v0.22.0 - Add integration commands diff --git a/api/src/resources/comment.rs b/api/src/resources/comment.rs index b6fc138..22aff79 100644 --- a/api/src/resources/comment.rs +++ b/api/src/resources/comment.rs @@ -624,9 +624,15 @@ pub struct Label { pub metadata: Option>, } +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] +pub enum PredictedLabelName { + Parts(Vec), + String(LabelName), +} + #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] pub struct PredictedLabel { - pub name: Vec, + pub name: PredictedLabelName, #[serde(skip_serializing_if = "Option::is_none")] pub sentiment: Option>, pub probability: NotNan, diff --git a/cli/src/commands/get/comments.rs b/cli/src/commands/get/comments.rs index 02f7b8e..66b6f60 100644 --- a/cli/src/commands/get/comments.rs +++ b/cli/src/commands/get/comments.rs @@ -8,8 +8,8 @@ use regex::Regex; use reinfer_client::{ resources::{ comment::{ - CommentTimestampFilter, MessagesFilter, PropertyFilterKind, ReviewedFilterEnum, - UserPropertiesFilter, + CommentTimestampFilter, MessagesFilter, PredictedLabelName, PropertyFilterKind, + ReviewedFilterEnum, UserPropertiesFilter, }, dataset::{ Attribute, AttributeFilter, AttributeFilterEnum, OrderEnum, QueryRequestParams, @@ -613,7 +613,9 @@ fn get_comments_from_uids( auto_threshold_labels .iter() .map(|auto_threshold_label| PredictedLabel { - name: auto_threshold_label.name.to_owned(), + name: PredictedLabelName::String(LabelName( + auto_threshold_label.name.join(" > "), + )), sentiment: None, probability: auto_threshold_label.probability, auto_thresholds: Some(