From 267c3219cfb9adf28c0470adf93a0f018962f64b Mon Sep 17 00:00:00 2001 From: Martin Stancsics Date: Mon, 23 Sep 2024 13:17:38 +0200 Subject: [PATCH] Make the check work with the new changes --- src/tabmat/categorical_matrix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tabmat/categorical_matrix.py b/src/tabmat/categorical_matrix.py index 3cda6fa5..7c445a48 100644 --- a/src/tabmat/categorical_matrix.py +++ b/src/tabmat/categorical_matrix.py @@ -426,9 +426,9 @@ def cat(self): "This property will be removed in the next major release.", category=DeprecationWarning, ) - try: + if pd: return pd.Categorical.from_codes(self.indices, categories=self.categories) - except NameError: + else: raise ModuleNotFoundError( "The `cat` property is provided for backward compatibility and " "requires pandas to be installed."