Skip to content

Commit

Permalink
Use correct keyword for artifact store open (#3220)
Browse files Browse the repository at this point in the history
  • Loading branch information
schustmi authored Nov 26, 2024
1 parent ae7f0e2 commit 9bfa980
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/zenml/artifact_stores/base_artifact_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/zenml/artifacts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/zenml/io/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions src/zenml/io/local_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9bfa980

Please sign in to comment.