Skip to content

Commit

Permalink
Fix cache invalidation in IdentityReader (AmpX-AI#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmi authored Oct 21, 2022
1 parent 2074875 commit d8e7deb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions fsql/deser.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,15 @@ class FileInPartition:
fs: AbstractFileSystem

def consume(self, fd_consumer: Callable[[OpenFile], Any]):
with self.fs.open(self.file_url) as fd:
try:
try:
with self.fs.open(self.file_url) as fd:
return fd_consumer(fd)
except FileNotFoundError as e:
logger.warning(
f"file {self.file_url} reading exception {type(e)}, attempting cache invalidation and reread"
)
self.fs.invalidate_cache()
except FileNotFoundError as e:
logger.warning(
f"file {self.file_url} reading exception {type(e)}, attempting cache invalidation and reread"
)
self.fs.invalidate_cache()
with self.fs.open(self.file_url) as fd:
return fd_consumer(fd)


Expand Down

0 comments on commit d8e7deb

Please sign in to comment.