Skip to content

Commit dd18564

Browse files
updates
1 parent 8728170 commit dd18564

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

adlfs/spec.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,14 +1292,9 @@ async def _rm_file(self, path: str, **kwargs):
12921292
container=container_name
12931293
) as cc:
12941294
await cc.delete_blob(p)
1295-
except ResourceNotFoundError:
1296-
pass
1297-
except FileNotFoundError:
1298-
pass
12991295
except Exception as e:
13001296
raise RuntimeError("Failed to remove %s for %s", path, e) from e
1301-
1302-
rm_file = sync_wrapper(_rm_file)
1297+
self.invalidate_cache(self._parent(path))
13031298

13041299
async def _separate_directory_markers_for_non_empty_directories(
13051300
self, file_paths: typing.Iterable[str]

adlfs/tests/test_spec.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2147,8 +2147,12 @@ def test_rm_file(storage):
21472147
account_name=storage.account_name,
21482148
connection_string=CONN_STR,
21492149
)
2150-
path = "data/top_file.txt"
2150+
path = "data/test_file.txt"
2151+
with fs.open(path, "wb") as f:
2152+
f.write(b"test content")
21512153

2154+
assert fs.exists(path)
21522155
fs.rm_file(path)
21532156
with pytest.raises(FileNotFoundError):
21542157
fs.ls(path)
2158+
assert not fs.exists(path)

0 commit comments

Comments
 (0)