sdk-codegen icon indicating copy to clipboard operation
sdk-codegen copied to clipboard

Looks are not updated if filters on custom dimensions/measures need to be replaced

Open johandebeurs opened this issue 2 years ago • 0 comments
trafficstars

Using the sample code below, I am trying to replace all instances of an old field name with a new field name.

look_id = 1234
find_text = 'foo.bar'
replace_text = 'bar.baz'

sdk = looker_sdk.init40()
look = sdk.look(look_id=look_id)

look.url = look.url.replace(
    find_text,
    replace_text
)

body = {
    'dynamic_fields': look.query.dynamic_fields.replace(find_text,replace_text),
    'expanded_share_url': look.query.expanded_share_url.replace(find_text,replace_text),
    'url': look.query.url.replace(find_text,replace_text)
}
look.query.update(iterable=body)

look_v2 = sdk.update_look(
    look_id=look_id,
    body=look
)

When investigating the content of the look object prior to update, the content is correctly set, however, when inspecting the content of look_v2 after update, there is no change, despite the updated_at attribute changing

johandebeurs avatar Nov 03 '23 08:11 johandebeurs