bito-code-review[bot] commented on code in PR #35420:
URL: https://github.com/apache/superset/pull/35420#discussion_r2395151843
##########
superset/sql/dialects/pinot.py:
##########
@@ -95,3 +101,8 @@ def datatype_sql(self, expression: exp.DataType) -> str:
return f"{type_sql} UNSIGNED{nested}"
return f"{type_sql}{nested}"
+
+ def cast_sql(self, expression: exp.Cast, safe_prefix: str | None =
None) -> str:
+ # Pinot doesn't support MySQL's TIMESTAMP() function
+ # Use standard CAST syntax instead
+ return super(MySQL.Generator, self).cast_sql(expression,
safe_prefix)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>super() call syntax</b></div>
<div id="fix">
The cast_sql method uses incorrect super() syntax with explicit class
specification. This will cause method resolution issues in the inheritance
chain between Pinot.Generator and MySQL.Generator, potentially leading to
infinite recursion or incorrect CAST behavior. Fix by using modern Python 3
super() syntax.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```suggestion
return super().cast_sql(expression, safe_prefix)
```
</div>
</details>
</div>
<div><details><summary><b>Review Rule</b></summary><div>Bito created the
rule <strong><code>Use Python 3 super() syntax without
arguments</code></strong> for <strong>repo:</strong>
<code>apache/superset</code>, <strong>language:</strong> <code>Python</code>.
Bito will avoid suggestions that match this rule. You can manage review rules
<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>here</a>.</div></details></div>
<small><i>Code Review Run <a
href=https://github.com/apache/superset/pull/35420#issuecomment-3357113736>#ebb48d</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]