tests pass; still need catalog

This commit is contained in:
Chang She
2023-12-21 20:13:08 -08:00
parent 587fe6ffc1
commit 9eca8e7cd1
2 changed files with 8 additions and 4 deletions

View File

@@ -595,7 +595,11 @@ class LanceTable(Table):
raise ValueError(
f"Index already exists. Use replace=True to overwrite."
)
fs.delete_dir(path)
try:
fs.delete_dir(path)
except FileNotFoundError as e:
if "Cannot get information for path" in str(e):
pass
index = create_index(self._get_fts_index_path(), field_names)
populate_index(index, self, field_names)

View File

@@ -95,12 +95,12 @@ def test_create_index_from_table(tmp_path, table):
]
)
with pytest.raises(ValueError, match="already exists"):
table.create_fts_index("text")
table.create_fts_index("text", replace=True)
assert len(table.search("gorilla").limit(1).to_pandas()) == 1
with pytest.raises(ValueError, match="already exists"):
table.create_fts_index("text")
def test_create_index_multiple_columns(tmp_path, table):
table.create_fts_index(["text", "text2"])