{"record":{"id":"b77f6b16a080824d","repo":"getredash/redash","slug":"0-is-not-a-supported-column-type","errorCode":null,"errorMessage":"'{0}' is not a supported column type","messagePattern":"'(.+?)' is not a supported column type","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"redash/query_runner/python.py","lineNumber":193,"sourceCode":"    def custom_inplacevar(op, x, y):\n        if op not in IOPERATOR_TO_STR.values():\n            raise Exception(\"'{} is not supported inplace variable'\".format(op))\n        glb = {\"x\": x, \"y\": y}\n        exec(\"x\" + op + \"y\", glb)\n        return glb[\"x\"]\n\n    @staticmethod\n    def add_result_column(result, column_name, friendly_name, column_type):\n        \"\"\"Helper function to add columns inside a Python script running in Redash in an easier way\n\n        Parameters:\n        :result dict: The result dict\n        :column_name string: Name of the column, which should be consisted of lowercase latin letters or underscore.\n        :friendly_name string: Name of the column for display\n        :column_type string: Type of the column. Check supported data types for details.\n        \"\"\"\n        if column_type not in SUPPORTED_COLUMN_TYPES:\n            raise Exception(\"'{0}' is not a supported column type\".format(column_type))\n\n        if \"columns\" not in result:\n            result[\"columns\"] = []\n\n        result[\"columns\"].append({\"name\": column_name, \"friendly_name\": friendly_name, \"type\": column_type})\n\n    @staticmethod\n    def add_result_row(result, values):\n        \"\"\"Helper function to add one row to results set.\n\n        Parameters:\n        :result dict: The result dict\n        :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.\n        \"\"\"\n        if \"rows\" not in result:\n            result[\"rows\"] = []\n\n        result[\"rows\"].append(values)","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/getredash/redash/blob/ca79fe988d81cdac9675b412f3dfcab107bc1fbc/redash/query_runner/python.py#L175-L211","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nadd_result_column(result, 'age', 'Age', 'int64')\n# after\nadd_result_column(result, 'age', 'Age', 'integer')","handlingStrategy":"type-guard","validationCode":"from redash.query_runner.python import SUPPORTED_COLUMN_TYPES\ncols = ['integer','float','boolean','string','date','datetime']\nassert set(cols) <= set(SUPPORTED_COLUMN_TYPES)","typeGuard":"def column_type_ok(t: str) -> bool:\n    return t in SUPPORTED_COLUMN_TYPES","tryCatchPattern":null,"preventionTips":["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"],"tags":["redash","python-runner","result-schema","type-validation"],"backgroundTag":"unsupported-column-type","analyzedSha":"ca79fe988d81cdac9675b412f3dfcab107bc1fbc","analyzedAt":"2026-08-28T18:32:34.637Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}