diff --git a/dvc/command/machine.py b/dvc/command/machine.py index a8e552685..cdea6a3d9 100644 --- a/dvc/command/machine.py +++ b/dvc/command/machine.py @@ -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: diff --git a/dvc/ui/table.py b/dvc/ui/table.py index 2a204f26d..a6e0655ed 100644 --- a/dvc/ui/table.py +++ b/dvc/ui/table.py @@ -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]