bito-code-review[bot] commented on code in PR #35007:
URL: https://github.com/apache/superset/pull/35007#discussion_r2324017048
##########
tests/integration_tests/model_tests.py:
##########
@@ -448,11 +448,14 @@ def query_with_expr_helper(self, is_timeseries,
inner_join=True):
return None
old_inner_join = spec.allows_joins
spec.allows_joins = inner_join
+
+ # Use database-specific string concatenation syntax
arbitrary_gby = (
- "state OR gender OR '_test'"
+ "CONCAT(state, gender, '_test')"
if get_example_database().backend == "mysql"
else "state || gender || '_test'"
)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incorrect database backend detection logic</b></div>
<div id="fix">
The database backend detection logic was changed to always use
`get_example_database().backend` instead of the actual table's database
backend. This will generate incorrect SQL concatenation syntax when the table
is from a database with a different backend than the example database, causing
SQL syntax errors in production.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```suggestion
# Use database-specific string concatenation syntax
database = self.get_database_by_id(tbl.database_id)
if database.backend == "mysql":
arbitrary_gby = "CONCAT(state, gender, '_test')"
else:
# Use PostgreSQL/SQLite style for other databases
arbitrary_gby = "state || gender || '_test'"
```
</div>
</details>
</div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35007#issuecomment-3256957170>#e218aa</a></i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]