]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: disable mypy error in diskprediction_local module 63931/head
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 13 Jun 2025 22:05:50 +0000 (18:05 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 13 Jun 2025 22:05:50 +0000 (18:05 -0400)
Currently on python 3.12 mypy detects one of the variables used in the
expression as an zero-element tuple. This module is not getting a lot
of attention so I'm doing the bare minimum to stop the tests from
failing here and silencing mypy with a magic comment.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/diskprediction_local/predictor.py

index 3bbe7a4b7f232f227d1ed0735d4f16296bd9c52b..858c52965941ccbf015633976bc7ba217418aeae 100644 (file)
@@ -168,7 +168,7 @@ class RHDiskFailurePredictor(Predictor):
         roll_window_size = 6
 
         # rolling means generator
-        dataset_size = disk_days_attrs.shape[0] - roll_window_size + 1
+        dataset_size = disk_days_attrs.shape[0] - roll_window_size + 1  # type: ignore
         gen = (disk_days_attrs[i: i + roll_window_size, ...].mean(axis=0)
                for i in range(dataset_size))
         means = np.vstack(gen)  # type: ignore