feat: not found errors with suggestions#5830
feat: not found errors with suggestions#5830wjones127 wants to merge 3 commits intolance-format:mainfrom
Conversation
PR Review: feat: not found errors with suggestionsP0 Issues (Critical Bugs)1. Duplicate code and unreachable statements in Lines 496-502 in the diff show duplicated code that will never execute: Err(Error::invalid_input(error_msg, location!())); // This returns Err but result is ignored
lance_core::levenshtein::find_best_suggestion(value, &valid_index_types); // Unreachable
let mut error_msg = format!("invalid index type: {}", value); // Unreachable - redeclares error_msg
if let Some(suggestion) = suggestion { // Uses wrong suggestion variable
error_msg = format!("{}. Did you mean '{}'?", error_msg, suggestion);
}
Err(Error::invalid_input(error_msg, location!()))The first 2. Python test assertions are inside Lines 55-61 and 64-70 in the test show assertions placed inside the with pytest.raises(FieldNotFoundError) as e:
ds.scanner(columns=["non_existent_field"]).to_table()
# These assertions never execute because the line above raises
expected = (...)
assert str(e.value) == expectedThe assertions after 3. Test file committed to repo: This appears to be a development test file that shouldn't be committed. It's not part of any crate and won't compile as-is (wrong imports, missing dependencies). P1 Issues (Should Fix)4. Levenshtein tests have incorrect assertions ( Line 425-426: assert_eq!(levenshtein_distance("vector", "vector"), 0);
assert_eq!(levenshtein_distance("vector", "vector"), 1); // Should be different inputsBoth lines compare "vector" to "vector" but expect different results (0 and 1). The second line appears to be a copy-paste error - likely should test "vector" vs "vactor" or similar. 5. Unused error type added to
6. Line 299: This changes |
Closes #5642