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

fix(cli): correct the comparison of upload status #4643

Merged
merged 1 commit into from
Apr 12, 2024
Merged
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
12 changes: 6 additions & 6 deletions src/bentoml/_internal/cloud/bentocloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def push_model(model: Model) -> None:
if (
not force
and remote_bento
and remote_bento.upload_status == BentoUploadStatus.SUCCESS
and remote_bento.upload_status == BentoUploadStatus.SUCCESS.value
):
self.spinner.log_progress.add_task(
f'[bold blue]Push skipped: Bento "{bento.tag}" already exists in remote Bento store'
Expand Down Expand Up @@ -394,7 +394,7 @@ def chunk_upload(
status=BentoUploadStatus.FAILED,
reason=str(e),
)
if finish_req.status is BentoUploadStatus.FAILED:
if finish_req.status == BentoUploadStatus.FAILED.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed to upload Bento "{bento.tag}"'
)
Expand All @@ -406,7 +406,7 @@ def chunk_upload(
version=version,
req=finish_req,
)
if finish_req.status != BentoUploadStatus.SUCCESS:
if finish_req.status != BentoUploadStatus.SUCCESS.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed pushing Bento "{bento.tag}": {finish_req.reason}'
)
Expand Down Expand Up @@ -633,7 +633,7 @@ def _do_push_model(
if (
not force
and remote_model
and remote_model.upload_status == ModelUploadStatus.SUCCESS
and remote_model.upload_status == ModelUploadStatus.SUCCESS.value
):
self.spinner.log_progress.add_task(
f'[bold blue]Model "{model.tag}" already exists in remote model store, skipping'
Expand Down Expand Up @@ -851,7 +851,7 @@ def chunk_upload(
status=ModelUploadStatus.FAILED,
reason=str(e),
)
if finish_req.status is ModelUploadStatus.FAILED:
if finish_req.status == ModelUploadStatus.FAILED.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed to upload model "{model.tag}"'
)
Expand All @@ -864,7 +864,7 @@ def chunk_upload(
req=finish_req,
)

if finish_req.status != ModelUploadStatus.SUCCESS:
if finish_req.status != ModelUploadStatus.SUCCESS.value:
self.spinner.log_progress.add_task(
f'[bold red]Failed pushing model "{model.tag}" : {finish_req.reason}'
)
Expand Down
Loading