My ultimate goal here is to pass all users’ Group values as JDBC Additional parameters (as query_tags to Snowflake if that matters). We have Groups named for the user’s location and access level (e.g. DEMO1_Writer, DEMO1_Viewer, DEMO2_Writer, DEMO2_Viewer...). From long conversations with Looker Support, I’ve learned that the only way for me to accomplish this is to create a User Attribute (customer_type) and assign the User Attribute’s Group Value to match the Group name. The case doesn’t matter for this use case, but here is what this looks like in the Looker Admin UI:
The problem is that I need to script this change into multiple instances of Looker, so I don’t want to use the Admin UI.
I need to both create the new User Attribute, and set the Group Values to match the Group Names in a Python script. Once I have this done, I’ll also need to add the User Attribute as a query_tag in the Additional JDBC parameters field (e.g. “query_tag=customer_type:{{ _user_attributes['customer_type'] }}”).
Does anyone have some guidance or examples for someone who is new to Looker and new to Python?