Skip to content

Commit

Permalink
fix: % replace in values_for_column
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida authored and eschutho committed Apr 30, 2024
1 parent 51da5ad commit f76ddf0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,10 @@ def values_for_column(
sql = self._apply_cte(sql, cte)
sql = self.database.mutate_sql_based_on_config(sql)

# pylint: disable=protected-access
if engine.dialect.identifier_preparer._double_percents:
sql = sql.replace("%%", "%")

df = pd.read_sql_query(sql=sql, con=engine)
# replace NaN with None to ensure it can be serialized to JSON
df = df.replace({np.nan: None})
Expand Down

0 comments on commit f76ddf0

Please sign in to comment.