Constants Failing to Resolve in SQL Code Generation

We started experiencing this issue recently and I wanted to reach out to the community to see if anyone else is similarly experiencing it.

At the end of last week (2022-07-08) we saw SQL in Looks, Dashboards, and Explores that still had the names of constants we’d defined in the manifest.lkml file instead of the values they should resolve to. This resulted in an “unknown escape sequence” error for users. At the time we were on Looker version 22.4 and were recommended to upgrade to version 22.10. We did so and this did seem to resolve the issue. However, as of today (2022-07-14) we have started seeing this error again. It seems we are able to stave this off by updating the new_lookml_runtime argument in our Project Manifest to “no” and hitting the refresh webhook, prompting a rebuild. In our theory, this prompts the SQL snippets to rebuild, this time without the constant names and resolve correctly. Though, this seems an unsatisfactory resolution to this problem since constants appear to be a supported feature and the documentation doesn’t say anything advising against using it in the way we are.

Example of how we define the constant in the manifest.lookml:
constant: get_user_name {

value: "(SELECT name FROM users WHERE id = ${TABLE}.ref_user)"

}

Example of how constant is used in code:

sql: CASE WHEN ${bool_allow_pii} THEN @{get_user_name} ELSE ${msg_sensitive_data} END ;;

Screenshot of error:

5c8bf099-9f11-41be-b166-91cc01252590.png
0 1 584
1 REPLY 1

@tylerb-16298269 
This seems to be a bug and is resolved from version 22.12.11+ 
 

Top Labels in this Space
Top Solution Authors