|
1 | 1 | import logging |
2 | 2 | from contextlib import closing |
3 | 3 |
|
| 4 | +from tableauserverclient.config import BYTES_PER_MB, config |
| 5 | + |
4 | 6 | from tableauserverclient.models.permissions_item import PermissionsRule |
5 | 7 | from tableauserverclient.server.endpoint.endpoint import QuerysetEndpoint, api |
6 | 8 | from tableauserverclient.server.endpoint.exceptions import MissingRequiredFieldError, UnsupportedAttributeError |
@@ -264,7 +266,7 @@ def _get_view_csv(self, view_item: ViewItem, req_options: "CSVRequestOptions | N |
264 | 266 | url = f"{self.baseurl}/{view_item.id}/data" |
265 | 267 |
|
266 | 268 | with closing(self.get_request(url, request_object=req_options, parameters={"stream": True})) as server_response: |
267 | | - yield from server_response.iter_content(1024) |
| 269 | + yield from server_response.iter_content(config.CHUNK_SIZE_MB * BYTES_PER_MB) |
268 | 270 |
|
269 | 271 | @api(version="3.8") |
270 | 272 | def populate_excel(self, view_item: ViewItem, req_options: "ExcelRequestOptions | None" = None) -> None: |
@@ -303,7 +305,7 @@ def _get_view_excel(self, view_item: ViewItem, req_options: "ExcelRequestOptions |
303 | 305 | url = f"{self.baseurl}/{view_item.id}/crosstab/excel" |
304 | 306 |
|
305 | 307 | with closing(self.get_request(url, request_object=req_options, parameters={"stream": True})) as server_response: |
306 | | - yield from server_response.iter_content(1024) |
| 308 | + yield from server_response.iter_content(config.CHUNK_SIZE_MB * BYTES_PER_MB) |
307 | 309 |
|
308 | 310 | @api(version="3.2") |
309 | 311 | def populate_permissions(self, item: ViewItem) -> None: |
|
0 commit comments