diff --git a/docs/hub-prod/test-cloud-sync.ipynb b/docs/hub-prod/test-cloud-sync.ipynb index 3c4d1f9e..b34b559b 100644 --- a/docs/hub-prod/test-cloud-sync.ipynb +++ b/docs/hub-prod/test-cloud-sync.ipynb @@ -312,8 +312,8 @@ "source": [ "time.sleep(1)\n", "cloud_file = dir_sync / \"file1\"\n", - "# update cloud timestamp, exist_ok=False needed due to truncate=not exist_ok in upath\n", - "cloud_file.touch(exist_ok=False) \n", + "# update cloud timestamp\n", + "cloud_file.fs.touch(cloud_file.as_posix(), truncate=True) \n", "\n", "assert cloud_file.modified.timestamp() > local_file_new.stat().st_mtime" ] diff --git a/lamindb_setup/_delete.py b/lamindb_setup/_delete.py index ba85d438..eb858316 100644 --- a/lamindb_setup/_delete.py +++ b/lamindb_setup/_delete.py @@ -24,7 +24,7 @@ def delete_cache(isettings: InstanceSettings): # avoid init of root root = isettings.storage._root_init if not isinstance(root, LocalPathClasses): - cache_dir = isettings.storage.cache_dir / root + cache_dir = isettings.storage.cache_dir / root.path if cache_dir.exists(): shutil.rmtree(cache_dir) diff --git a/lamindb_setup/core/_settings_storage.py b/lamindb_setup/core/_settings_storage.py index e278cb1d..f22d6539 100644 --- a/lamindb_setup/core/_settings_storage.py +++ b/lamindb_setup/core/_settings_storage.py @@ -380,7 +380,7 @@ def is_on_hub(self) -> bool: return True def cloud_to_local( - self, filepath: UPathStr, cache_key: UPathStr | None = None, **kwargs + self, filepath: UPathStr, cache_key: str | None = None, **kwargs ) -> UPath: """Local (or local cache) filepath from filepath.""" # cache_key is ignored in cloud_to_local_no_update if filepath is local @@ -391,13 +391,12 @@ def cloud_to_local( return local_filepath def cloud_to_local_no_update( - self, filepath: UPathStr, cache_key: UPathStr | None = None + self, filepath: UPathStr, cache_key: str | None = None ) -> UPath: # cache_key is ignored if filepath is local if isinstance(filepath, UPath) and not isinstance(filepath, LocalPathClasses): - # Path / UPath discards protocol from UPath if present local_filepath = self.cache_dir / ( - filepath if cache_key is None else cache_key + filepath.path if cache_key is None else cache_key ) else: local_filepath = filepath diff --git a/pyproject.toml b/pyproject.toml index 875e64bc..98ba9a6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "pydantic-settings", "appdirs<2.0.0", "requests", - "universal_pathlib==0.2.2", # is still experimental, need pinning + "universal_pathlib==0.2.5", # is still experimental, need pinning "botocore<2.0.0", "gotrue>=2.1.0,<2.9.0", # lower - for options in auth.sign_out, upper - 2.9.0 fails "supabase==2.2.1",