From 3f6301dbc953e8b976e1de0d08caf0ac397a7db4 Mon Sep 17 00:00:00 2001 From: Tamo Date: Thu, 19 Sep 2024 10:58:45 +0200 Subject: [PATCH] fix the missing embedder name in the error message when trying to disable the binary quantization --- meilisearch/tests/vector/binary_quantized.rs | 2 +- milli/src/update/settings.rs | 2 +- milli/src/vector/settings.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meilisearch/tests/vector/binary_quantized.rs b/meilisearch/tests/vector/binary_quantized.rs index 0f3819586..10f731d75 100644 --- a/meilisearch/tests/vector/binary_quantized.rs +++ b/meilisearch/tests/vector/binary_quantized.rs @@ -225,7 +225,7 @@ async fn try_to_disable_binary_quantization() { } }, "error": { - "message": "`.embedders.todo.binaryQuantized`: Cannot disable the binary quantization", + "message": "`.embedders.manual.binaryQuantized`: Cannot disable the binary quantization", "code": "invalid_settings_embedders", "type": "invalid_request", "link": "https://docs.meilisearch.com/errors#invalid_settings_embedders" diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 40aa22a81..63db5237c 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1007,7 +1007,7 @@ impl<'a, 't, 'i> Settings<'a, 't, 'i> { // updated config EitherOrBoth::Both((name, (old, user_provided)), (_, new)) => { let was_quantized = old.binary_quantized.set().unwrap_or_default(); - let settings_diff = SettingsDiff::from_settings(old, new)?; + let settings_diff = SettingsDiff::from_settings(&name, old, new)?; match settings_diff { SettingsDiff::Remove => { tracing::debug!( diff --git a/milli/src/vector/settings.rs b/milli/src/vector/settings.rs index 9b2c1c6e3..3bb7f09e6 100644 --- a/milli/src/vector/settings.rs +++ b/milli/src/vector/settings.rs @@ -140,6 +140,7 @@ pub struct WriteBackToDocuments { impl SettingsDiff { pub fn from_settings( + embedder_name: &str, old: EmbeddingSettings, new: Setting, ) -> Result { @@ -181,7 +182,7 @@ impl SettingsDiff { && matches!(new_binary_quantize, Setting::Set(false)) { return Err(UserError::InvalidDisableBinaryQuantization { - embedder_name: String::from("todo"), + embedder_name: embedder_name.to_string(), }); }