Skip to content

Commit

Permalink
allow http storages
Browse files Browse the repository at this point in the history
  • Loading branch information
Koncopd committed Dec 16, 2024
1 parent 01e5e7e commit 1c14b3a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lamindb_setup/core/_settings_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def init_storage(
root_str = f"s3://lamin-{region}/{uid}"
else:
root_str = f"s3://lamin-hosted-test/{uid}"
elif root_str.startswith(("gs://", "s3://", "hf://")):
elif root_str.startswith(("gs://", "s3://", "hf://", "http://", "https://")):
pass
else: # local path
try:
Expand Down Expand Up @@ -227,7 +227,7 @@ def _mark_storage_root(self) -> UPath:

@property
def record(self) -> Any:
"""Storage record in current instance."""
"""Storage record in the current instance."""
if self._record is None:
# dynamic import because of import order
from lnschema_core.models import Storage
Expand Down Expand Up @@ -299,10 +299,10 @@ def region(self) -> str | None:
return self._region

@property
def type(self) -> Literal["local", "s3", "gs"]:
def type(self) -> Literal["local", "s3", "gs", "hf", "http", "https"]:
"""AWS S3 vs. Google Cloud vs. local.
Returns the protocol as a string: "local", "s3", "gs".
Returns the protocol as a string: "local", "s3", "gs", "http", "https".
"""
import fsspec

Expand Down Expand Up @@ -345,5 +345,5 @@ def key_to_filepath(self, filekey: UPathStr) -> UPath:
return self.root / filekey

def local_filepath(self, filekey: UPathStr) -> UPath:
"""Local (cache) filepath from filekey: `local(filepath(...))`."""
"""Local (cache) filepath from filekey."""
return self.cloud_to_local(self.key_to_filepath(filekey))

0 comments on commit 1c14b3a

Please sign in to comment.