getredash/redash · error · Exception
'{0}' is not a supported column type
Error message
'{0}' is not a supported column type What it means
add_result_column() is the Python runner's API for declaring result columns; column_type must be one of the SUPPORTED_COLUMN_TYPES (Redash's BOOLEAN/INTEGER/FLOAT/DATE/DATETIME/STRING style set). Any other type string is rejected because the result schema would be unrenderable.
Source
Thrown at redash/query_runner/python.py:193
def custom_inplacevar(op, x, y):
if op not in IOPERATOR_TO_STR.values():
raise Exception("'{} is not supported inplace variable'".format(op))
glb = {"x": x, "y": y}
exec("x" + op + "y", glb)
return glb["x"]
@staticmethod
def add_result_column(result, column_name, friendly_name, column_type):
"""Helper function to add columns inside a Python script running in Redash in an easier way
Parameters:
:result dict: The result dict
:column_name string: Name of the column, which should be consisted of lowercase latin letters or underscore.
:friendly_name string: Name of the column for display
:column_type string: Type of the column. Check supported data types for details.
"""
if column_type not in SUPPORTED_COLUMN_TYPES:
raise Exception("'{0}' is not a supported column type".format(column_type))
if "columns" not in result:
result["columns"] = []
result["columns"].append({"name": column_name, "friendly_name": friendly_name, "type": column_type})
@staticmethod
def add_result_row(result, values):
"""Helper function to add one row to results set.
Parameters:
:result dict: The result dict
:values dict: One row of result in dict. The key should be one of the column names. The value is the value of the column in this row.
"""
if "rows" not in result:
result["rows"] = []
result["rows"].append(values)View on GitHub (pinned to ca79fe988d)
Solutions
- Use only Redash supported types: check SUPPORTED_COLUMN_TYPES in the installed python.py (e.g. 'integer', 'float', 'boolean', 'string', 'date', 'datetime')
- Map dtypes explicitly: int64->integer, float64->float, bool->boolean, object->string
- Upgrade/downgrade alignment: ensure query code matches the SUPPORTED_COLUMN_TYPES of the running Redash version
Example fix
# before add_result_column(result, 'age', 'Age', 'int64') # after add_result_column(result, 'age', 'Age', 'integer')
Defensive patterns
Strategy: type-guard
Validate before calling
from redash.query_runner.python import SUPPORTED_COLUMN_TYPES cols = ['integer','float','boolean','string','date','datetime'] assert set(cols) <= set(SUPPORTED_COLUMN_TYPES)
Type guard
def column_type_ok(t: str) -> bool:
return t in SUPPORTED_COLUMN_TYPES Prevention
- Map pandas dtypes to Redash types explicitly, never pass numpy dtype names
- Use dataframe_to_result/pandas_to_result helpers instead of hand-building columns
When it happens
Trigger: Calling add_result_column(result, 'col', 'Col', 'number') or 'str'/'int64'/'object' — any type alias not in SUPPORTED_COLUMN_TYPES; commonly hit in dataframe_to_result when pandas dtypes are mapped to unsupported names.
Common situations: Converting a pandas DataFrame to Redash results and passing numpy/pandas type names instead of Redash type names; new Redash version with a changed supported type list.
Related errors
- local variable `result` should be of type `dict`.
- 'pagination.path' should be a string
- 'pagination.fields' should be a list of 2 field names
- '{0}' is not configured as a supported import module
- '{} is not supported inplace variable
AI-assisted analysis of getredash/redash@ca79fe988d (2026-08-28).
Data as JSON: /api/errors/b77f6b16a080824d.
Report an issue: GitHub.