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: fix table overflow with fold #4677

Merged
merged 1 commit into from May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 23 additions & 19 deletions src/bentoml_cli/deployment.py
Expand Up @@ -282,9 +282,11 @@ def update( # type: ignore
scaling_min=scaling_min,
instance_type=instance_type,
strategy=strategy,
envs=[{"name": item.split("=")[0], "value": item.split("=")[1]} for item in env]
if env is not None
else None,
envs=(
[{"name": item.split("=")[0], "value": item.split("=")[1]} for item in env]
if env is not None
else None
),
config_file=config_file,
config_dict=cfg_dict,
)
Expand Down Expand Up @@ -402,9 +404,11 @@ def apply( # type: ignore
scaling_min=scaling_min,
instance_type=instance_type,
strategy=strategy,
envs=[{"key": item.split("=")[0], "value": item.split("=")[1]} for item in env]
if env is not None
else None,
envs=(
[{"key": item.split("=")[0], "value": item.split("=")[1]} for item in env]
if env is not None
else None
),
config_file=config_file,
config_dict=cfg_dict,
)
Expand Down Expand Up @@ -622,12 +626,12 @@ def list_command( # type: ignore
)
res: list[dict[str, t.Any]] = [d.to_dict() for d in d_list]
if output == "table":
table = Table(box=None)
table.add_column("Deployment")
table.add_column("created_at")
table.add_column("Bento")
table.add_column("Status")
table.add_column("Region")
table = Table(box=None, expand=True)
table.add_column("Deployment", overflow="fold")
table.add_column("created_at", overflow="fold")
table.add_column("Bento", overflow="fold")
table.add_column("Status", overflow="fold")
table.add_column("Region", overflow="fold")
for info in d_list:
table.add_row(
info.name,
Expand Down Expand Up @@ -666,13 +670,13 @@ def list_instance_types( # type: ignore
)
res: list[dict[str, t.Any]] = [d.to_dict() for d in d_list]
if output == "table":
table = Table(box=None)
table.add_column("Name")
table.add_column("Price")
table.add_column("CPU")
table.add_column("Memory")
table.add_column("GPU")
table.add_column("GPU Type")
table = Table(box=None, expand=True)
table.add_column("Name", overflow="fold")
table.add_column("Price", overflow="fold")
table.add_column("CPU", overflow="fold")
table.add_column("Memory", overflow="fold")
table.add_column("GPU", overflow="fold")
table.add_column("GPU Type", overflow="fold")
for info in d_list:
table.add_row(
info.name,
Expand Down