From f8532b6aa1f63f197961bfb69caecaea3a4a2a03 Mon Sep 17 00:00:00 2001 From: Matthias Schmidtblaicher Date: Tue, 30 Jan 2024 18:21:20 +0100 Subject: [PATCH] don't use getattr unnecessarily --- src/glum/_glm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glum/_glm.py b/src/glum/_glm.py index e5f0fcde..eea1c477 100644 --- a/src/glum/_glm.py +++ b/src/glum/_glm.py @@ -890,9 +890,9 @@ def _convert_from_pandas( df, self.feature_dtypes_, getattr(self, "has_missing_category_", {}), - getattr(self, "cat_missing_method", "fail"), + cat_missing_method_after_alignment, ) - if getattr(self, "cat_missing_method", "fail") == "convert": + if cat_missing_method_after_alignment == "convert": df = _add_missing_categories( df=df, dtypes=self.feature_dtypes_,