From 86f23452752032f6768d312e2d772dca8b3c6beb Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 20 Jan 2024 11:07:54 -0500 Subject: [PATCH] pybind/mgr/dashboard: correct type signature of CRUDEndpoint arg Typing issue was found by mypy 1.5.1. The type only accepted values of str but based on the data and code using set_column data the boolean assignments to the 'isHidden' key were correct and so I updated the type to also accept bool. A more correct fix might be to use typing.TypedDict - this would require python 3.8 (or typing extensions) and someone more familiar with the dashboard code :-) Signed-off-by: John Mulligan --- src/pybind/mgr/dashboard/controllers/_crud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/controllers/_crud.py b/src/pybind/mgr/dashboard/controllers/_crud.py index d65649cadb4..855832ff550 100644 --- a/src/pybind/mgr/dashboard/controllers/_crud.py +++ b/src/pybind/mgr/dashboard/controllers/_crud.py @@ -332,7 +332,7 @@ class CRUDEndpoint: CRUDClassMetadata: Optional[RESTController] = None def __init__(self, router: APIRouter, doc: APIDoc, - set_column: Optional[Dict[str, Dict[str, str]]] = None, + set_column: Optional[Dict[str, Dict[str, Union[str, bool]]]] = None, actions: Optional[List[TableAction]] = None, permissions: Optional[List[str]] = None, forms: Optional[List[Form]] = None, column_key: Optional[str] = None, -- 2.39.5