From 26355994407b9cb56fff11f96d9ef7751610e4b8 Mon Sep 17 00:00:00 2001 From: mg515 Date: Fri, 22 Dec 2023 13:04:38 +0100 Subject: [PATCH] bugfix wrong directory structure --- squirrel/artifact_manager/fs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/squirrel/artifact_manager/fs.py b/squirrel/artifact_manager/fs.py index 48e68b7..220b2cf 100644 --- a/squirrel/artifact_manager/fs.py +++ b/squirrel/artifact_manager/fs.py @@ -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 @@ -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(), }, )