Skip to content

Commit

Permalink
use lamindb_setup.settings.paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Koncopd committed Oct 16, 2024
1 parent 0175854 commit 56e9a36
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lamindb/_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ def open(
filepath.name == "soma" or filepath.suffix == ".tiledbsoma"
) and mode == "w"
# consider the case where an object is already locally cached
localpath = setup_settings.instance.storage.cloud_to_local_no_update(
localpath = setup_settings.paths.cloud_to_local_no_update(
filepath, cache_key=cache_key
)
if not is_tiledbsoma_w and localpath.exists():
Expand Down Expand Up @@ -963,12 +963,12 @@ def _synchronize_cleanup_on_error(
filepath: UPath, cache_key: str | None = None
) -> UPath:
try:
cache_path = setup_settings.instance.storage.cloud_to_local(
cache_path = setup_settings.paths.cloud_to_local(
filepath, cache_key=cache_key, print_progress=True
)
except Exception as e:
if not isinstance(filepath, LocalPathClasses):
cache_path = setup_settings.instance.storage.cloud_to_local_no_update(
cache_path = setup_settings.paths.cloud_to_local_no_update(

Check warning on line 971 in lamindb/_artifact.py

View check run for this annotation

Codecov / codecov/patch

lamindb/_artifact.py#L971

Added line #L971 was not covered by tests
filepath, cache_key=cache_key
)
if cache_path.is_file():
Expand Down Expand Up @@ -1156,9 +1156,7 @@ def _cache_path(self) -> UPath:
)
if isinstance(filepath, LocalPathClasses):
return filepath
return setup_settings.instance.storage.cloud_to_local_no_update(
filepath, cache_key=cache_key
)
return setup_settings.paths.cloud_to_local_no_update(filepath, cache_key=cache_key)


# docstring handled through attach_func_to_class_method
Expand Down

0 comments on commit 56e9a36

Please sign in to comment.