Skip to content

Commit

Permalink
bugfix wrong directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mg515 committed Dec 22, 2023
1 parent 3fd4f21 commit 2635599
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions squirrel/artifact_manager/fs.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from pathlib import Path
from typing import Optional, Any, List, Iterable
from typing import Any, Iterable, List, Optional

from squirrel.artifact_manager.base import ArtifactManager
from squirrel.catalog import Catalog, Source
from squirrel.serialization import MessagepackSerializer, JsonSerializer, SquirrelSerializer
from squirrel.serialization import (JsonSerializer, MessagepackSerializer,
SquirrelSerializer)
from squirrel.store import FilesystemStore
from squirrel.store.filesystem import get_random_key

Expand Down Expand Up @@ -191,15 +192,16 @@ def download_artifact(
version = f"v{max(int(vs[1:]) for vs in self.backend.complete_key(Path(collection) / Path(artifact)))}"
if isinstance(to, str):
to = Path(to)
to = to / artifact
location = Path(collection, artifact, version)
self.backend.get(Path(location), target=to)
return Source(
driver_name="file",
driver_kwargs={"url": str(Path(to, artifact))},
driver_kwargs={"url": to.resolve()},
metadata={
"collection": collection,
"artifact": artifact,
"version": version,
"location": str(Path(to, artifact)),
"location": to.resolve(),
},
)

0 comments on commit 2635599

Please sign in to comment.