bito-code-review[bot] commented on PR #40455:
URL: https://github.com/apache/superset/pull/40455#issuecomment-4551805179
<!-- Bito Reply -->
The PR comments file contains only one comment entry, which matches the
suggestion in question. The suggestion is valid and addresses a logic error in
the BigQuery literal compiler. The current implementation escapes single quotes
but leaves backslashes untouched, which can lead to invalid SQL when values end
with a backslash. The suggested fix is to escape backslashes before apostrophes
or use the dialect literal processor to ensure valid string literals for all
inputs.
**superset/db_engine_specs/bigquery.py**
```
val = element.value.replace("'", "\\'"); return f"'{val}'"
```
**superset/db_engine_specs/bigquery.py**
```
val = element.value.replace("\\", "\\\\").replace("'", "\\'"); return
f"'{val}'"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]