Handle OSError for missing LightGBM dependency

Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
This commit is contained in:
David Kyle 2022-11-02 16:32:27 +00:00 committed by GitHub
parent 82e34dbddb
commit 211cc2c83f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,5 +93,9 @@ try:
"LGBMClassifierTransformer",
]
_MODEL_TRANSFORMERS.update(_LIGHTGBM_MODEL_TRANSFORMERS)
except ImportError:
# LightGBM may be installed but missing a required library
# (e.g. libomp) in which case an OSError is thrown. Allow
# the error to happen here so that code using other features
# is not blocked by the missing dependency
except (ImportError, OSError):
pass