{"record":{"id":"02e0681c484e5115","repo":"apache/superset","slug":"alert-query-returned-a-non-number-value","errorCode":null,"errorMessage":"Alert query returned a non-number value.","messagePattern":"Alert query returned a non-number value\\.","errorType":"exception","errorClass":"AlertQueryInvalidTypeError","httpStatus":422,"severity":"error","filePath":"superset/commands/report/alert.py","lineNumber":166,"sourceCode":"                )\n            )\n\n    def _validate_operator(self, rows: np.recarray[Any, Any]) -> None:\n        self._validate_result(rows)\n\n        if rows[0][1] is None or pd.isna(rows[0][1]):\n            self._result = None\n            self._info_message = \"Query returned NULL value\"\n            return\n\n        if rows[0][1] == 0:\n            self._result = 0.0\n            return\n        try:\n            self._result = float(rows[0][1])\n            return\n        except (AssertionError, TypeError, ValueError) as ex:\n            raise AlertQueryInvalidTypeError() from ex\n\n    @property\n    def _is_validator_not_null(self) -> bool:\n        return (\n            self._report_schedule.validator_type == ReportScheduleValidatorType.NOT_NULL\n        )\n\n    @property\n    def _is_validator_operator(self) -> bool:\n        return (\n            self._report_schedule.validator_type == ReportScheduleValidatorType.OPERATOR\n        )\n\n    def _get_alert_metadata_from_object(self) -> dict[str, Any]:\n        return {\n            \"report_schedule_id\": self._report_schedule.id,\n            \"execution_id\": self._execution_id,\n        }","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/report/alert.py#L148-L184","documentation":"Error \"Alert query returned a non-number value.\" thrown in apache/superset.","triggerScenarios":"The alert query returns a non-numeric value that cannot be compared to the threshold.","commonSituations":"Executing an alert whose query result value is not numeric, so threshold comparison is impossible.","solutions":["Cast or transform the alert query result to a numeric value before comparing with the threshold."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}