mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
ui: remove None in CellT type
From https://github.com/iterative/dvc/pull/6893/files#r777784748 Table rendering does not support `None` for now, and we will change it back after (#7167).
This commit is contained in:
@@ -241,6 +241,7 @@ class CmdMachineStatus(CmdBase):
|
||||
"instance_hdd_size",
|
||||
"instance_gpu",
|
||||
]
|
||||
FILL_VALUE = "-"
|
||||
|
||||
def _add_row(
|
||||
self,
|
||||
@@ -250,7 +251,11 @@ class CmdMachineStatus(CmdBase):
|
||||
):
|
||||
|
||||
if not all_status:
|
||||
row = [name, None, "offline"]
|
||||
row = [
|
||||
name,
|
||||
self.FILL_VALUE,
|
||||
"offline",
|
||||
] # back to `None` after #7167
|
||||
td.append(row)
|
||||
for i, status in enumerate(all_status, start=1):
|
||||
row = [name, f"num_{i}", "running" if status else "offline"]
|
||||
@@ -264,7 +269,7 @@ class CmdMachineStatus(CmdBase):
|
||||
raise MachineDisabledError
|
||||
|
||||
td = TabularData(
|
||||
self.INSTANCE_FIELD + self.SHOWN_FIELD, fill_value="-"
|
||||
self.INSTANCE_FIELD + self.SHOWN_FIELD, fill_value=self.FILL_VALUE
|
||||
)
|
||||
|
||||
if self.args.name:
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
||||
SHOW_MAX_WIDTH = 1024
|
||||
|
||||
|
||||
CellT = Union[str, "RichText", None] # RichText is mostly compatible with str
|
||||
CellT = Union[str, "RichText"] # RichText is mostly compatible with str
|
||||
Row = Sequence[CellT]
|
||||
TableData = Sequence[Row]
|
||||
Headers = Sequence[str]
|
||||
|
||||
Reference in New Issue
Block a user