giftig commented on code in PR #34074:
URL: https://github.com/apache/superset/pull/34074#discussion_r2186995640
##########
superset/common/query_context_processor.py:
##########
@@ -924,7 +947,12 @@ def get_viz_annotation_data( # noqa: C901
if not (query_context := chart.get_query_context()):
raise QueryObjectValidationError(
- _("The chart query context does not exist"),
+ _(
+ f"""The query context for chart ID {chart.id}
(referenced
Review Comment:
Minor point to consider here, it's better to use regular strings and
implicit concantenation for stuff like this, i.e.
```
_(
f"The query context for chart ID {chart.id} (referenced "
f"by annotation layer '{annotation_layer["name"]}' was not found "
"Please ensure the chart is properly configured and has a valid "
"query context"
)
```
The main reason being triple-quoted strings will preserve all the whitespace
inbetween. I suspect this isn't a problem here either because babel deals with
it or because it's being rendered as HTML and all the whitespace collapsed
anyway, but it's best to do it that way to avoid surprises.
--
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]