Discussions about using Looker API and its SDK's -- from schedules to scripting
- 413 Topics
- 1,185 Replies
When I try to test my action in the configuration screen, or when I try to actually use the action, it always says Invalid URL.This is all I see in my docker log for the Action Hub instance:info: Starting request. url=/, ip=::ffff:192.168.62.3, statusCode=200, instanceId=742792674bb07674057f327d35cdf32a, webhookId=adb6065a26199172e5f78e49440219d4info: HTTP POST / statusCode=200, url=/, method=POST, httpVersion=1.1, originalUrl=/, , responseTime=6, url=/, ip=::ffff:192.168.62.3, statusCode=200, instanceId=742792674bb07674057f327d35cdf32a, webhookId=adb6065a26199172e5f78e49440219d4Thanks
I have been fighting with the SDKs for the last few weeks trying to build out an Angular application. Prior to using the SDKs, I was able to perform most essential API functions with my Angular app with a “middleware” service that communicates with an Express proxy. I am trying to do a few more complex things that will require me to do inline queries in Looker and it seems that it will be easier to use the SDK to chain these actions. We already have a method of performing authentication that will happen outside of the Angular/Express apps (it is using Oauth and lives on a separate backend server). That service performs the authentication and then passes me user details and the bearer token. I am able to use the API directly to get dashboards, looks, users, etc. Where I start to have issues is when attempting more complex operations. One example is in a “tabbed dashboard” scenario…We have implemented a convention where we group several dashboards together in a folder. One of those dashb
Hi all, I have been working on a use case to bulk add a specific board to “Favorites” for a list of users, which may help new users discover useful contents quicker and easier.I am posting my script with comments to explain the workflow below for your reference. You can also run the script as a one-off task in Google Colab -- please find the link to the notebook in my Git repo. Here is an example for add_boards_to_users(board_id: int, users_id: list)import looker_sdksdk = looker_sdk.init40() def add_boards_to_users(board_id: int, users_id: list): """ Add a specific board to the "Favorite" contents for a list of user Args: board_id (int): id of a Looker board (https://company.looker.com/boards/id) users_id (list): a list of users in the form of a native Python list Returns: "Successfully added!" (str) Raises: N/A (does not explicitly raise an exception); Looker SDK will raise an error. """ """ This statement is using sdk.board() to retrieve content_metadata_id, which is u
I’ve created a parent dashboard with a widget that drills to another dashboard. So, can I capture the filter values set on the parent dashboard and pass them along to the child dashboard? Example: My clients may filter the parent dashboard down by state or equipment manufacture. The child dashboard would also filter by those values as well.
Hi Team, I am totally new to Looker, can you please guide me on exporting metadata details of which all looks/Dashboards are available in my org. I have enabled API, but not sure how to make use of it, I request any one of you to guide me how and where to run the code/script so that i can get dashboard details, attributes which have been used in that dashboard.. etc.. Note: I got Admin access as well.
We are wanting to add the ability to schedule and send emails from our embedded implementation as it is a heavily requested feature. Great we thought, we will just add the schedule_look_emails permission to our embed url and be done with it. Unfortunately we have run into a few problems and appear to have exhausted all the options with no workaround in sight. The crux of the issue is that we have the Looker supplied filters turned off in all of our dashboards because we did a custom implementation to make the design match our app and improve the ux. example: Because Show Filters is turned off, we discovered that the option to include selected filters is not present in the dialog to schedule an email. Off: On: The consequence of this is that the email gets scheduled with the default values defined on the dashboard, and not the values that are currently rendered based on the user’s selection. This is confusing and not what would be expected. To make matters worse some of our dashbo
Hi all,One common request we get is how to bulk update or reassign schedules. A common use case for this is when users leave the company. First and foremost, do not delete the user before updating the schedules as the schedules and any information on them will be lost.Generally, we recommend using the API for mass changes in schedules. I’ve written a template below on how to do a bulk re-assign of schedules using the Looker python SDK, but feel free to adjust it in any way to fit your use case. Please read through the commented notes!import jsonimport looker_sdkfrom looker_sdk import models# Note that this is assuming we've downloaded the Looker python sdk and that we've set up the ini file in the same folder as this program# Please refer to https://github.com/looker-open-source/sdk-codegen/tree/main/python for how to download the sdk and create the ini filesdk = looker_sdk.init31("looker.ini")# First create a Look that contains a list of scheduled plans & their cron tab that need
Hi - I might be missing something obvious here, but thought I’d ask anyway! Sometimes we need to update something about our underlying data that requires us to update filter values or remove filters across all or some dashboards/looks/merged queries. It doesn’t seem like there’s a great way to get a list of all the places where a dimension/measure is used as a filter. My goal, at a minimum, is to get a list of dashboards/looks/merged queries to check manually or plug into a function that will allow me to update/remove the targeted filter.So far, I’ve looked at:looker_sdk (for python) Fivetran (article) has also written their own custom code (github) to do this (although, it’s not leveraging looker_sdk).I’m wondering if there’s an easy-ish way to do this ,without going through some of the hoops Fivetran seems to go through, and leverage the API via looker_sdk.Another thought I have is to leverage the Content Validator -- comment out the field I’m updating and get a list of all the error
Hi I’m building a custom visualization where we need to make an additional query based on the data passed in. The generic flow looks like this:Pass the queried dataset into the visualization. Visualization looks at the first row and gets an id (it will be unique for the dataset). Visualization makes another query to get potentially large amount of metadata associated with that id. Use the associated metadata to render the data.In our specific case our “dataset” is a set of locations which have x/y coordinates, and our “metadata” is a large png image file that they will be rendered on top of. The image file is dynamic so we can’t use built in looker mapping tools. In our case, we have a couple of different ways to query the data, either through an API call to our server APIs or by making an additional query to looker. Our APIs are authentication, and I’m not sure how to get the looker visualization authenticated. The ideal option, I think, would be to be able to make a subsequent query
Hello friends, I need to create a Pandas DataFrame (Python) that includes all information about tables used specifically the field sql_table_name . I have already connections and currently I can get information about explores from my looker instance, but with this way I get only view_name and other fields. How I can get [model, explore,sql_table_name ] ? Thank you !!
Hi,I am trying to connect to the Looker API using Python and followed the documentation about how to use the API. I created the “looker.ini” file with the API credentials but it throws me the same error every time. Below is the snippet of code and the error. Appreciate any help.import looker_sdkimport osimport jsonsdk = looker_sdk.init31('looker.ini')my_user = sdk.me()##Below is the ErrorSDKError: b"HTTPSConnectionPool(host='devamlooker.[company].com', port=9999): Max retries exceeded with url: /api/3.1/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fe0888e34d0>: Failed to establish a new connection: [Errno -2] Name or service not known'))"
Hi everyone, What happens to a schedule when the LookML dashboard it is attached to is deleted via API?Our process for embedded dashboards requires deleting them and recreating them from time to time in order to account for model changes and we need to ensure the schedules are not lost.Is there a recommended approach to update the schedule in order to attach it to a new LookML dashboard? Thanks!
Hi all, I’ve created several Looks from a view which is based on a derived table. The Look (without any filters active) will show a handful of records, but I’ve created the Looks with several default filter values such that most of the time, the Look will display ‘No results’ (except when some extreme values are reached, in which case the Look will show a record for the object reaching an extreme value). These Looks are scheduled every hour, but I’ve selected Send if: there are results and results changed since last run. Hence, it should not send me any e-mails as long as there are no results if I’m correct. However, it does send e-mails every hour, all of the time having a visualisation which says ‘No results’. See below the scheduling details: What am I missing here? Why is not working as I’d think it should work? As additional info, we’re running Looker 4.14. Let me know if you need any more info 🙂 Thanks!
I have a new looker instance and will be migrating from another system in a slow role. I am trying to avoid having to manually apply groups or roles to users as they login for the first time.I am using SAML for login intergrations, however I would like to use a custom attribute to define group access. I can do this with other systems we integrate with, but not with Looker.The OOTB approach requires groups, which we don’t have setup for this custom attribute. I am wondering if anyone else has done this with the API. Thank you!
Hello, We are unable to view looker reports with latest chrome’s SameSite Cookie updates from google as per this https://www.chromium.org/updates/same-site Works fine with other browsers like firefox More can be found in this screenshot I’m assuming Looker team is already aware of this release from Google and are working on setting cookies with SameSite= None? Thanks
I have set up a daily scheduled delivery of a look (the look is just a table) to run if there are results and if results have changed since last run. However I am receiving the look every day even when there are have been no changes since the previous day. Is this a known bug? How can I get the report to send ONLY IF results have changed since the last run?
Already have an account? Login
Login to the community
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.