Skip to content

fix: fix deletion when using file-object-store://#5760

Merged
westonpace merged 8 commits intolance-format:mainfrom
cmccabe:colin_fix_file_object_store
Jan 21, 2026
Merged

fix: fix deletion when using file-object-store://#5760
westonpace merged 8 commits intolance-format:mainfrom
cmccabe:colin_fix_file_object_store

Conversation

@cmccabe
Copy link
Copy Markdown
Contributor

@cmccabe cmccabe commented Jan 20, 2026

When using file-object-store://, we currently do not delete directories that are empty. This is because the other object stores (such as s3) don't need this. This PR fixes this to explicitly delete the empty directories when using file-object-store://.

This fixes a bug where tables appear to be undeletable when using file-object-store://

>>> db = lancedb.connect("file-object-store:///tmp/foo")
>>> table = db.create_table("my_table", schema=schema)
>>> db.table_names()
['my_table']
>>> db.drop_table("my_table")
>>> db.table_names()
['my_table']

When using file-object-store://, we currently do not delete directories
that are empty. This is because the other object stores (such as s3)
don't need this. This PR fixes this to explicitly delete the empty
directories whe using file-object-store://.
@github-actions github-actions Bot added the bug Something isn't working label Jan 20, 2026
Copy link
Copy Markdown
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

I guess I'm not sure what I'd expect as a user. Should it behave exactly as LocalObjectStore (in which case this PR is diverging from expectations) or just behave how we want it to?

I don't feel strongly enough to worry either way barring more input from any users so go for it.

Comment thread rust/lance-io/src/object_store.rs
@cmccabe
Copy link
Copy Markdown
Contributor Author

cmccabe commented Jan 21, 2026

I guess I'm not sure what I'd expect as a user. Should it behave exactly as LocalObjectStore (in which case this PR is diverging from expectations) or just behave how we want it to?

The big issue with the current behavior is that it breaks lancedb when using file-object-store://

>>> db = lancedb.connect("file-object-store:///tmp/foo")
>>> table = db.create_table("my_table", schema=schema)
>>> db.table_names()
['my_table']
>>> db.drop_table("my_table")
>>> db.table_names()
['my_table']

If you want to use file-object-store:// in unit testing, this is unfortunate.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@westonpace westonpace merged commit 6535621 into lance-format:main Jan 21, 2026
22 of 28 checks passed
wojiaodoubao added a commit to wojiaodoubao/lance that referenced this pull request Jan 22, 2026
majin1102 pushed a commit to majin1102/lance that referenced this pull request Jan 23, 2026
When using `file-object-store://`, we currently do not delete
directories that are empty. This is because the other object stores
(such as s3) don't need this. This PR fixes this to explicitly delete
the empty directories when using `file-object-store://`.

This fixes a bug where tables appear to be undeletable when using
`file-object-store://`

```
>>> db = lancedb.connect("file-object-store:///tmp/foo")
>>> table = db.create_table("my_table", schema=schema)
>>> db.table_names()
['my_table']
>>> db.drop_table("my_table")
>>> db.table_names()
['my_table']
```
vivek-bharathan pushed a commit to vivek-bharathan/lance that referenced this pull request Feb 2, 2026
When using `file-object-store://`, we currently do not delete
directories that are empty. This is because the other object stores
(such as s3) don't need this. This PR fixes this to explicitly delete
the empty directories when using `file-object-store://`.

This fixes a bug where tables appear to be undeletable when using
`file-object-store://`

```
>>> db = lancedb.connect("file-object-store:///tmp/foo")
>>> table = db.create_table("my_table", schema=schema)
>>> db.table_names()
['my_table']
>>> db.drop_table("my_table")
>>> db.table_names()
['my_table']
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants