Skip to content

Unable to download Look using look render task, gives very generic SDK error without specific details. #1564

Closed
@shcsd-aryba

Description

@shcsd-aryba

task1 = sdk.create_look_render_task(
look_id="123", # Ensure this Look ID exists
result_format="pdf", # Use a valid result format
width=545,
height=842
)

When I try to download the look using python sdk, i get SDK error with out any specific details, Has anyone ever tried to use this to download looks, or similar for query and dashboard element download?
Download dashboard on the other hand is works slightly differently, it takes additional body parameter with dashboard style, and filters etc and its working for me.

The error message when trying to download look:


SDKError Traceback (most recent call last)
File /home/user.name/git-repos/myrepo/LookerPdfDownload.py:17
---> 17 response = sdk.create_look_render_task(
18 look_id="3176", # Ensure this Look ID exists
19 result_format="pdf", # Use a valid result format
20 width=545,
21 height=842
22 )
23 print(response)

File ~/miniforge3/envs/py310/lib/python3.10/site-packages/looker_sdk/sdk/api40/methods.py:9357, in Looker40SDK.create_look_render_task(self, look_id, result_format, width, height, fields, transport_options)
9353 look_id = self.encode_path_param(look_id)
9354 result_format = self.encode_path_param(result_format)
9355 response = cast(
9356 mdls.RenderTask,
-> 9357 self.post(
9358 path=f"/render_tasks/looks/{look_id}/{result_format}",
9359 structure=mdls.RenderTask,
9360 query_params={"width": width, "height": height, "fields": fields},
9361 transport_options=transport_options,
9362 ),
9363 )
9364 return response

File ~/miniforge3/envs/py310/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py:180, in APIMethods.post(self, path, structure, query_params, body, transport_options)
171 serialized = self._get_serialized(body)
172 response = self.transport.request(
173 transport.HttpMethod.POST,
174 self._path(path),
(...)
178 transport_options=transport_options,
179 )
--> 180 return self._return(response, structure)

File ~/miniforge3/envs/py310/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py:93, in APIMethods._return(self, response, structure)
91 except serialize.DeserializeError:
92 raise error.SDKError(value)
---> 93 raise sdk_error
94 ret: TReturn
95 if structure is None:

SDKError:


Metadata

Metadata

Assignees

No one assigned

    Labels

    p3Priority 3pythonPython SDK issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions