1

My goal is to access views or charts I have stored in my Looker folder and add those automatically to power point slides. The tutorial I am following is this one: https://discourse.looker.com/t/generating-a-powerpoint-presentation-from-all-looks-in-a-space/8191.

My problem is at the point #Generate the PowerPoint (as per tutorial). When I run that command, the failure message states:

    103 chart_test
    Look failed 103: chart_test
    Failed to add image to slide

This corresponds to this piece of code where it fails:

try:
    image = looker_client.LookApi(client).run_look(**look_request)
    image_file = ''.join([str(look.id), '.png'])
    shutil.move(image, image_file)
except:
    print(f'Look failed {look.id}: {look.title}')
    image_file = None

When I print 'image_file', is empty ('None') although I have one line chart saved in this folder 2703 called 'chart_test'.

Can someone help please?

LaLaTi
  • 1,455
  • 3
  • 18
  • 31

1 Answers1

1

Check your parameters Example

look_request = {
            "look_id": 21, 
            "result_format": 'png', 
            "image_width": 960, 
            "image_height": 540
        } 

Try to use last sdk

import looker_sdk
import shutil 
from looker_sdk import models
sdk = looker_sdk.init40("looker.ini")
look_request = {
            "look_id": 21, 
            "result_format": 'html', 
            "image_width": 960, 
            "image_height": 540
        }

try:
    image1 = sdk.run_look(**look_request)
    image_file1 = '21.png'
    shutil.move(image1, image_file1)
except Exception as e:
    print(e)

You should a file looker.ini in the same folder with your py file.

Narcis
  • 11
  • 2