From 956240111abf1eda4321c0d7f5cd21dd393f70b8 Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Thu, 26 Mar 2020 14:58:13 +0100
Subject: [PATCH] requires_fit is not all available all the time

---
 bob/pipelines/mixins.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bob/pipelines/mixins.py b/bob/pipelines/mixins.py
index 1976b1a..46683c5 100644
--- a/bob/pipelines/mixins.py
+++ b/bob/pipelines/mixins.py
@@ -245,7 +245,7 @@ class SampleMixin(BaseEstimator):
         # See: https://scikit-learn.org/stable/developers/develop.html
         # if the estimator does not require fit or is stateless don't call fit
         tags = self._get_tags()
-        if tags["stateless"] or not tags["requires_fit"]:
+        if tags["stateless"] or ("requires_fit" in tags and not tags["requires_fit"]):
             return self
 
         # if the estimator needs to be fitted.
-- 
GitLab