From 9bfa9800e2891cd4e169a7ac95b6f923a663a47e Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Tue, 26 Nov 2024 16:54:54 +0100 Subject: [PATCH] Use correct keyword for artifact store open (#3220) --- src/zenml/artifact_stores/base_artifact_store.py | 4 ++-- src/zenml/artifacts/utils.py | 2 +- src/zenml/io/filesystem.py | 4 ++-- src/zenml/io/local_filesystem.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/zenml/artifact_stores/base_artifact_store.py b/src/zenml/artifact_stores/base_artifact_store.py index 283d4799615..5d800ed7b6e 100644 --- a/src/zenml/artifact_stores/base_artifact_store.py +++ b/src/zenml/artifact_stores/base_artifact_store.py @@ -267,11 +267,11 @@ def custom_cache_key(self) -> Optional[bytes]: # --- User interface --- @abstractmethod - def open(self, name: PathType, mode: str = "r") -> Any: + def open(self, path: PathType, mode: str = "r") -> Any: """Open a file at the given path. Args: - name: The path of the file to open. + path: The path of the file to open. mode: The mode to open the file. Returns: diff --git a/src/zenml/artifacts/utils.py b/src/zenml/artifacts/utils.py index 694ba1aa2b1..9b8ebaff93a 100644 --- a/src/zenml/artifacts/utils.py +++ b/src/zenml/artifacts/utils.py @@ -575,7 +575,7 @@ def download_artifact_files_from_response( ) file_path = str(Path(artifact.uri) / file_str) with artifact_store.open( - name=file_path, mode="rb" + file_path, mode="rb" ) as store_file: # Use a loop to read and write chunks of the file # instead of reading the entire file into memory diff --git a/src/zenml/io/filesystem.py b/src/zenml/io/filesystem.py index 2e07eb01421..744bcc48387 100644 --- a/src/zenml/io/filesystem.py +++ b/src/zenml/io/filesystem.py @@ -54,11 +54,11 @@ class BaseFilesystem(ABC): @staticmethod @abstractmethod - def open(name: PathType, mode: str = "r") -> Any: + def open(path: PathType, mode: str = "r") -> Any: """Opens a file. Args: - name: The path to the file. + path: The path to the file. mode: The mode to open the file in. Returns: diff --git a/src/zenml/io/local_filesystem.py b/src/zenml/io/local_filesystem.py index 4d1e7394c98..efc428e429d 100644 --- a/src/zenml/io/local_filesystem.py +++ b/src/zenml/io/local_filesystem.py @@ -55,18 +55,18 @@ class LocalFilesystem(BaseFilesystem): SUPPORTED_SCHEMES: ClassVar[Set[str]] = {""} @staticmethod - def open(name: PathType, mode: str = "r") -> Any: + def open(path: PathType, mode: str = "r") -> Any: """Open a file at the given path. Args: - name: The path to the file. + path: The path to the file. mode: The mode to open the file. Returns: Any: The file object. """ encoding = "utf-8" if "b" not in mode else None - return open(name, mode=mode, encoding=encoding) + return open(path, mode=mode, encoding=encoding) @staticmethod def copyfile(