Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct keyword for artifact store open #3220

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading