From e190433249b7dddd4fb09f2e2dd8b04c62c66604 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 11 Jan 2022 00:02:14 +0200 Subject: [PATCH] lint: add new ignores mypy: ``` dvc/utils/table.py: note: In member "add_column" of class "Table": dvc/utils/table.py:24:5: error: Argument 7 of "add_column" is incompatible with supertype "Table"; supertype defines the argument type as "Union[Literal['top'], Literal['middle'], Literal['bottom']]" [override] def add_column( # pylint: disable=arguments-differ ^ dvc/utils/table.py:24:5: note: This violates the Liskov substitution principle dvc/utils/table.py:24:5: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides dvc/utils/table.py:24:5: error: Argument 8 of "add_column" is incompatible with supertype "Table"; supertype defines the argument type as "Union[Literal['fold'], Literal['crop'], Literal['ellipsis'], Literal['ignore']]" [override] def add_column( # pylint: disable=arguments-differ ^ dvc/utils/table.py:24:5: error: Argument 12 of "add_column" is incompatible with supertype "Table"; supertype defines the argument type as "Optional[int]" [override] def add_column( # pylint: disable=arguments-differ ^ Found 3 errors in 1 file (checked 129 source files) dvc/ui/table.py:87: note: In module imported here, dvc/compare.py:25: note: ... from here: dvc/utils/table.py: note: In member "add_column" of class "Table": dvc/utils/table.py:24:5: error: Argument 7 of "add_column" is incompatible with supertype "Table"; supertype defines the argument type as "Union[Literal['top'], Literal['middle'], Literal['bottom']]" [override] def add_column( # pylint: disable=arguments-differ ^ dvc/utils/table.py:24:5: note: This violates the Liskov substitution principle dvc/utils/table.py:24:5: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides dvc/utils/table.py:24:5: error: Argument 8 of "add_column" is incompatible with supertype "Table"; supertype defines the argument type as "Union[Literal['fold'], Literal['crop'], Literal['ellipsis'], Literal['ignore']]" [override] def add_column( # pylint: disable=arguments-differ ^ dvc/utils/table.py:24:5: error: Argument 12 of "add_column" is incompatible with supertype "Table"; supertype defines the argument type as "Optional[int]" [override] def add_column( # pylint: disable=arguments-differ ^ Found 3 errors in 1 file (checked 128 source files) ``` pylint: ``` ************* Module dvc.utils.table dvc/utils/table.py:24:4: W0237: Parameter 'vertical' has been renamed to 'overflow' in overridden 'Table.add_column' method (arguments-renamed) dvc/utils/table.py:24:4: W0237: Parameter 'overflow' has been renamed to 'width' in overridden 'Table.add_column' method (arguments-renamed) dvc/utils/table.py:24:4: W0237: Parameter 'width' has been renamed to 'min_width' in overridden 'Table.add_column' method (arguments-renamed) dvc/utils/table.py:24:4: W0237: Parameter 'min_width' has been renamed to 'max_width' in overridden 'Table.add_column' method (arguments-renamed) dvc/utils/table.py:24:4: W0237: Parameter 'max_width' has been renamed to 'ratio' in overridden 'Table.add_column' method (arguments-renamed) dvc/utils/table.py:24:4: W0237: Parameter 'ratio' has been renamed to 'no_wrap' in overridden 'Table.add_column' method (arguments-renamed) dvc/utils/table.py:24:4: W0237: Parameter 'no_wrap' has been renamed to 'collapse' in overridden 'Table.add_column' method (arguments-renamed) ``` --- dvc/utils/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvc/utils/table.py b/dvc/utils/table.py index 880d84e2e..6d997549a 100644 --- a/dvc/utils/table.py +++ b/dvc/utils/table.py @@ -21,7 +21,7 @@ class Column(RichColumn): class Table(RichTable): - def add_column( # pylint: disable=arguments-differ + def add_column( # type: ignore[override] # pylint: disable=arguments-differ,arguments-renamed # noqa: E501 self, header: "RenderableType" = "", footer: "RenderableType" = "",