Skip to content

Commit

Permalink
chore: update opendal version
Browse files Browse the repository at this point in the history
Signed-off-by: yihong0618 <[email protected]>
  • Loading branch information
yihong0618 committed Feb 25, 2025
1 parent 91a218b commit f71a2ce
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 28 deletions.
11 changes: 2 additions & 9 deletions api/extensions/storage/opendal_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,8 @@ def download(self, filename: str, target_filepath: str):
logger.debug(f"file {filename} downloaded to {target_filepath}")

def exists(self, filename: str) -> bool:
# FIXME this is a workaround for opendal python-binding do not have a exists method and no better
# error handler here when opendal python-binding has a exists method, we should use it
# more https://github.com/apache/opendal/blob/main/bindings/python/src/operator.rs
try:
res: bool = self.op.stat(path=filename).mode.is_file()
logger.debug(f"file {filename} checked")
return res
except Exception:
return False
res: bool = self.op.exists(path=filename)
return res

def delete(self, filename: str):
if self.exists(filename):
Expand Down
78 changes: 60 additions & 18 deletions api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ yarl = "~1.18.3"
# Related transparent dependencies with pinned version
# required by main implementations
############################################################
opendal = "0.45.16"
[tool.poetry.group.indirect.dependencies]
kaleido = "0.2.1"
rank-bm25 = "~0.2.2"
Expand All @@ -105,7 +106,7 @@ bce-python-sdk = "~0.9.23"
cos-python-sdk-v5 = "1.9.30"
esdk-obs-python = "3.24.6.1"
google-cloud-storage = "2.16.0"
opendal = "~0.45.12"
opendal = "~0.45.16"
oss2 = "2.18.5"
supabase = "~2.8.1"
tos = "~2.7.1"
Expand Down

0 comments on commit f71a2ce

Please sign in to comment.