Solved

Module error for "sdk_exceptions"


Getting error while running api testing to generate pdf of dashboard.

 

icon

Best answer by Ranjit 1312 5 July 2021, 17:23

Hello @manishkamble19 ,

 

You could either copy the file sdk_exceptions.py from https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/sdk_exceptions.py and save it to the folder containing the your scrip for down_dashboard_pdf.py

 

This file is for custom error handling, you could replace all the lines such as “sdk_exceptions.ArgumentError” (sdk_exceptions . __) with simple “Exception” if you do not require the custom error handling.

 

Hope this helps!

View original

3 replies

for this script https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/download_dashboard_pdf.py

Hello @manishkamble19 ,

 

You could either copy the file sdk_exceptions.py from https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/sdk_exceptions.py and save it to the folder containing the your scrip for down_dashboard_pdf.py

 

This file is for custom error handling, you could replace all the lines such as “sdk_exceptions.ArgumentError” (sdk_exceptions . __) with simple “Exception” if you do not require the custom error handling.

 

Hope this helps!

Hello @manishkamble19 ,

 

You could either copy the file sdk_exceptions.py from https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/sdk_exceptions.py and save it to the folder containing the your scrip for down_dashboard_pdf.py

 

This file is for custom error handling, you could replace all the lines such as “sdk_exceptions.ArgumentError” (sdk_exceptions . __) with simple “Exception” if you do not require the custom error handling.

 

Hope this helps!

Ok Thanks Ranjit I will check on this. Also if you familiar with the looker API. I am facing some issue while passing filters in the code. Can you help me out @Ranjit 1312 .

I wants to add some filters on dashboard which are like below image.


But while parsing those filter values as argument in the API giving error. Any one knows how to avoid/resolve this error. Or what is the correct format to pass the filter values.

I am parsing the argument as below which is mentioned in the github API doc. 

$ python download_dashboard_pdf.py "A Test Dashboard" '{"filter1": "value1, value2", "filter2": "value3"}'

 

Reply