From: John Mulligan Date: Thu, 9 Jul 2026 20:12:11 +0000 (-0400) Subject: pybind/mgr: disable type checking in diskprediction_local X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc49390a36517b02e49bc350ce082912cc39103d;p=ceph.git pybind/mgr: disable type checking in diskprediction_local Disable type checking in the __preprocess function of diskprediction_local. This function is already collecting a lot of `type: ignore` comments and adding more is getting difficult due to the structure of this function. This time we were hitting errors like: diskprediction_local/predictor.py:160: error: Value of type "NDArray?[Any]" is not indexable [index] diskprediction_local/predictor.py:161: error: "NDArray?[Any]" has no attribute "shape" [attr-defined] on python 3.12. Fixes: https://tracker.ceph.com/issues/78117 Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/diskprediction_local/predictor.py b/src/pybind/mgr/diskprediction_local/predictor.py index 858c5296594..0e36a1d89c7 100644 --- a/src/pybind/mgr/diskprediction_local/predictor.py +++ b/src/pybind/mgr/diskprediction_local/predictor.py @@ -26,7 +26,7 @@ import os import json import pickle import logging -from typing import Any, Dict, List, Optional, Sequence, Tuple +from typing import Any, Dict, List, Optional, Sequence, Tuple, no_type_check import numpy as np @@ -119,6 +119,7 @@ class RHDiskFailurePredictor(Predictor): self.model_dirpath = model_dirpath + @no_type_check def __preprocess(self, disk_days: Sequence[DevSmartT], manufacturer: str) -> Optional[np.ndarray]: """Scales and transforms input dataframe to feed it to prediction model