codeant-ai-for-open-source[bot] commented on code in PR #43864:
URL: https://github.com/apache/superset/pull/43864#discussion_r3934431774
##########
superset/connectors/sqla/models.py:
##########
@@ -1234,7 +1234,10 @@ def get_sqla_col(
self.table.schema if self.table else None,
)
expression = self._validate_stored_expression(expression)
- col = literal_column(expression, type_=type_)
+ # Parenthesize calculated-column expressions so a bare boolean
+ # operator (e.g. OR) inside the expression cannot leak into the
+ # surrounding operator precedence (e.g. COUNT(DISTINCT ...)).
+ col = Grouping(literal_column(expression, type_=type_))
Review Comment:
**Suggestion:** `get_timestamp_expression` still emits calculated temporal
expressions without this grouping, so time-series queries can retain the same
boolean precedence bug. [incomplete implementation]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=7636e6fc6f364fa68278475dfd0760c6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=7636e6fc6f364fa68278475dfd0760c6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/connectors/sqla/models.py
**Line:** 1240:1240
**Comment:**
*Incomplete Implementation: `get_timestamp_expression` still emits
calculated temporal expressions without this grouping, so time-series queries
can retain the same boolean precedence bug.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43864&comment_hash=406cbe9bea3bfda708df346d9fdcce857b38214a259c79d614af65abcd31e89b&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43864&comment_hash=406cbe9bea3bfda708df346d9fdcce857b38214a259c79d614af65abcd31e89b&reaction=dislike'>๐</a>
--
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]