Skip to content

Commit

Permalink
fix!: expect correct google cloud storage abbreviation in query schem…
Browse files Browse the repository at this point in the history
…e (gcs://)
  • Loading branch information
johanneskoester committed Apr 26, 2024
1 parent 8edee25 commit beaea7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions snakemake_storage_plugin_gcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ def is_valid_query(cls, query: str) -> StorageQueryValidationResult:
valid=False,
reason=f"cannot be parsed as URL ({e})",
)
if parsed.scheme != "gs":
if parsed.scheme != "gcs":
return StorageQueryValidationResult(
query=query,
valid=False,
reason="must start with gs (gs://...)",
reason="must start with gcs scheme (gcs://...)",
)
return StorageQueryValidationResult(
query=query,
Expand All @@ -207,7 +207,7 @@ def example_queries(cls) -> List[ExampleQuery]:
"""
return [
ExampleQuery(
query="gs://mybucket/myfile.txt",
query="gcs://mybucket/myfile.txt",
type=QueryType.ANY,
description="A file in an google storage (GCS) bucket",
)
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class TestStorage(TestStorageBase):
files_only = False

def get_query(self, tmp_path) -> str:
return "gs://snakemake-test-bucket/test-file.txt"
return "gcs://snakemake-test-bucket/test-file.txt"

def get_query_not_existing(self, tmp_path) -> str:
bucket = uuid.uuid4().hex
key = uuid.uuid4().hex
return f"gs://{bucket}/{key}"
return f"gcs://{bucket}/{key}"

def get_storage_provider_cls(self) -> Type[StorageProviderBase]:
# Return the StorageProvider class of this plugin
Expand Down

0 comments on commit beaea7c

Please sign in to comment.