8000 Fixed type annotation for workbook.refresh · pes-magic/server-client-python@25a59d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 25a59d0

Browse files
committed
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: tableau#1318
1 parent 3ec49bc commit 25a59d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tableauserverclient/server/endpoint/workbooks_endpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def get_by_id(self, workbook_id: str) -> WorkbookItem:
8888
return WorkbookItem.from_response(server_response.content, self.parent_srv.namespace)[0]
8989

9090
@api(version="2.8")
91-
def refresh(self, workbook_id: str) -> JobItem:
92-
id_ = getattr(workbook_id, "id", workbook_id)
91+
def refresh(self, workbook_item: Union[WorkbookItem, str]) -> JobItem:
92+
id_ = getattr(workbook_item, "id", workbook_item)
9393
url = "{0}/{1}/refresh".format(self.baseurl, id_)
9494
empty_req = RequestFactory.Empty.empty_req()
9595
server_response = self.post_request(url, empty_req)

0 commit comments

Comments
 (0)
0