Skip to content

Commit 13baee7

Browse files
committed
feat: ExportService.get_raw_export_bytes() for Arrow IPC polling
Add a thin method that polls the raw export endpoint for an already-submitted export and returns Arrow IPC bytes. Reuses the existing _get_exported_content() polling loop; the caller is responsible for submitting the execution and export request.
1 parent 88dea4b commit 13baee7

File tree

1 file changed

+33
-0
lines changed
  • packages/gooddata-sdk/src/gooddata_sdk/catalog/export

1 file changed

+33
-0
lines changed

packages/gooddata-sdk/src/gooddata_sdk/catalog/export/service.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,39 @@ def export_tabular_by_visualization_id(
329329
max_retry=max_retry,
330330
)
331331

332+
def get_raw_export_bytes(
333+
self,
334+
workspace_id: str,
335+
export_id: str,
336+
timeout: float = 60.0,
337+
retry: float = 0.2,
338+
max_retry: float = 5.0,
339+
) -> bytes:
340+
"""
341+
Poll the raw export endpoint for an already-submitted export and return the Arrow IPC bytes.
342+
343+
The caller is responsible for submitting the AFM execution and the export request
344+
(via ``actions_api.create_raw_export``), then passing the resulting ``export_id`` here.
345+
346+
Args:
347+
workspace_id (str): The ID of the target workspace.
348+
export_id (str): Export ID returned by ``create_raw_export``.
349+
timeout (float): Total seconds to wait for the export to complete. Defaults to 60.0.
350+
retry (float): Initial wait between retries in seconds. Defaults to 0.2.
351+
max_retry (float): Maximum wait between retries in seconds. Defaults to 5.0.
352+
353+
Returns:
354+
bytes: Arrow IPC bytes that can be read with ``pyarrow.ipc.open_file``.
355+
"""
356+
return self._get_exported_content(
357+
workspace_id=workspace_id,
358+
export_id=export_id,
359+
get_func=self._actions_api.get_raw_export,
360+
timeout=timeout,
361+
retry=retry,
362+
max_retry=max_retry,
363+
)
364+
332365
def export_slides(
333366
self,
334367
workspace_id: str,

0 commit comments

Comments
 (0)