bito-code-review[bot] commented on code in PR #38689:
URL: https://github.com/apache/superset/pull/38689#discussion_r3977763101
##########
tests/unit_tests/models/helpers_test.py:
##########
@@ -5759,3 +5760,121 @@ def test_filter_adhoc_column(database: Database) ->
None:
# The adhoc column resolved by label is parenthesized in the WHERE clause,
# consistent with inline adhoc columns, to guard operator precedence.
assert "lower((real_name)) LIKE lower('Zona%')" in sql
+
+
+def test_columns_by_name_verbose_overrides_column_name(database: Database) ->
None:
+ """
+ Test that verbose_name does NOT override existing column_name mapping.
+ """
+ from superset.connectors.sqla.models import SqlaTable, TableColumn
+
+ # Column1: revenue (verbose_name="sales")
+ # Column2: sales (no verbose_name)
+ col1 = TableColumn(column_name="revenue", verbose_name="sales")
+ col2 = TableColumn(column_name="sales", verbose_name=None)
+
+ table = SqlaTable(database=database, table_name="test_table",
columns=[col1, col2])
+
+ columns_by_name = table.columns_by_name
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing attribute in tests</b></div>
<div id="fix">
`SqlaTable` (and its bases `CoreDataset`/`BaseDatasource`/`ExploreMixin`)
defines no `columns_by_name` attribute — it only exists as a local variable
inside `get_sqla_query`. Every access here raises `AttributeError`, so all
seven new tests fail. Add the property to `SqlaTable` or construct the dict
inline in each test.
</div>
</div>
<small><i>Code Review Run #8278d8</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]