You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/03/16 23:27:28 UTC

(superset) 01/01: fix(sqla): pass catalog and schema to get_sqla_engine in values_for_column

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fix/values-for-column-schema-context
in repository https://gitbox.apache.org/repos/asf/superset.git

commit b2c10f909b9e1bf60dcbda952402743fff3a8de4
Author: Superset Dev <de...@superset.apache.org>
AuthorDate: Mon Mar 16 16:27:10 2026 -0700

    fix(sqla): pass catalog and schema to get_sqla_engine in values_for_column
    
    The `values_for_column()` method, which powers the native filter value
    dropdown, was calling `self.database.get_sqla_engine()` without passing
    `catalog` or `schema`. This meant `adjust_engine_params()` was invoked
    without schema context, so databases that encode the schema in the
    connection URL (MySQL, Snowflake, Presto, etc.) would not apply the
    correct schema for filter dropdown queries.
    
    Every other query path in `ExploreMixin` already passes `self.catalog`
    and `self.schema` — this change makes `values_for_column()` consistent.
    
    Closes #32498
    
    Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
---
 superset/models/helpers.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index f6f28f63850..e9ad3ddd9bb 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -2456,7 +2456,9 @@ class ExploreMixin:  # pylint: disable=too-many-public-methods
         if rls_filters:
             qry = qry.where(and_(*rls_filters))
 
-        with self.database.get_sqla_engine() as engine:
+        with self.database.get_sqla_engine(
+            catalog=self.catalog, schema=self.schema
+        ) as engine:
             sql = str(qry.compile(engine, compile_kwargs={"literal_binds": True}))
             sql = self._apply_cte(sql, cte)