From 25a59d0f8f54fb872c068b2f14cf366dd3a18e76 Mon Sep 17 00:00:00 2001 From: Fumiya Suto Date: Mon, 13 Nov 2023 20:26:42 +0900 Subject: [PATCH] Fixed type annotation for workbook.refresh `workbook.refresh` is implemented to accept both `WorkbookItem` and `str` as arguments, but the type annotation describes it as receiving `str`, which can cause false warnings in static analysis. Since the documentation states that it receives `workbook_item`, the name of the argument is also changed from `workbook_id` to `workbook_item`. Issue: https://github.com/tableau/server-client-python/issues/1318 --- tableauserverclient/server/endpoint/workbooks_endpoint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tableauserverclient/server/endpoint/workbooks_endpoint.py b/tableauserverclient/server/endpoint/workbooks_endpoint.py index a73b0f0d5..3c8efbe3b 100644 --- a/tableauserverclient/server/endpoint/workbooks_endpoint.py +++ b/tableauserverclient/server/endpoint/workbooks_endpoint.py @@ -88,8 +88,8 @@ def get_by_id(self, workbook_id: str) -> WorkbookItem: return WorkbookItem.from_response(server_response.content, self.parent_srv.namespace)[0] @api(version="2.8") - def refresh(self, workbook_id: str) -> JobItem: - id_ = getattr(workbook_id, "id", workbook_id) + def refresh(self, workbook_item: Union[WorkbookItem, str]) -> JobItem: + id_ = getattr(workbook_item, "id", workbook_item) url = "{0}/{1}/refresh".format(self.baseurl, id_) empty_req = RequestFactory.Empty.empty_req() server_response = self.post_request(url, empty_req)