Skip to content

Commit

Permalink
locked python client to engine@v0.11.0 (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
epinzur authored Sep 20, 2023
1 parent a916379 commit fdcdeb7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clients/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "kaskada"
version = "0.5.2"
version = "0.5.3"
description = "A client library for the Kaskada time travel machine learning service"
authors = ["Kaskada <maintainers@kaskada.io>"]
license = "Apache-2.0"
Expand Down
6 changes: 4 additions & 2 deletions clients/python/src/kaskada/api/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def download_release(
download_path: Path,
manager_bin_name: str,
engine_bin_name: str,
engine_version: Optional[str] = None,
engine_version: Optional[str] = "engine@v0.11.0",
) -> LocalRelease:
"""Downloads the appropriate version of the kaskada-manager and kaskada-engine services.
Args:
download_path (Path): The local download path
manager_bin_name (str): The name of the manager binary to save in download path
engine_bin_name (str): The name of the engine binary to save in download path
engine_version (Optional[str]): The engine version to download, e.g., engine@v<semantic-version>. Defaults to None for latest release.
engine_version (Optional[str]): The engine version to download, e.g., engine@v<semantic-version>. Defaults to engine@v0.11.0
Raises:
RuntimeError: unable to get release assets
Expand All @@ -75,6 +75,8 @@ def download_release(

repo = self._github.get_repo(f"{self.ORGANIZATION}/{self.REPO_NAME}")

# we don't expect this code path any longer,
# since the default version is now set to a string
if engine_version is None:
downloaded_release = repo.get_latest_release()
logger.info(f"Using latest release version: {downloaded_release.tag_name}")
Expand Down
4 changes: 2 additions & 2 deletions clients/python/src/kaskada/api/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ class LocalBuilder(Builder):

manager_configs: Dict[str, Any]
engine_configs: Dict[str, Any]
# The engine version to download, e.g., `engine@v1.2.3-beta.1`. Defaults to None to get latest release.
# The engine version to download, e.g., `engine@v1.2.3-beta.1`. Defaults to engine@v0.11.0
_engine_version: Optional[str]

def __init__(
self,
endpoint: str = kaskada.client.KASKADA_DEFAULT_ENDPOINT,
is_secure: bool = kaskada.client.KASKADA_IS_SECURE,
engine_version: Optional[str] = None,
engine_version: Optional[str] = "engine@v0.11.0",
) -> None:
super().__init__()
self.manager_configs = {"-no-color": "1"}
Expand Down
6 changes: 4 additions & 2 deletions clients/python/tests/api/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ def test_local_builder_set_engine_version():
version = "engine@v0.0.1-beta.1"
builder = kaskada.api.session.LocalBuilder().engine_version(version)
assert builder._engine_version == version



def test_local_builder_set_engine_version_throws():
invalid_versions = ["0.0.1", "engine@0.0.1", "engine@v23", "manager@v1.1.1"]

for version in invalid_versions:
with pytest.raises(ValueError):
builder = kaskada.api.session.LocalBuilder().engine_version(version)


def test_local_builder_set_path_sets_path():
path = "my_path"
builder = kaskada.api.session.LocalBuilder().path(path)
Expand Down

0 comments on commit fdcdeb7

Please sign in to comment.