From 61ed94823bc96bec255b0d7c49ff623bb31869f2 Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Thu, 23 Jan 2025 01:15:32 -0800 Subject: [PATCH] fix(ingest): improve registry error message (#12440) --- metadata-ingestion/src/datahub/ingestion/api/registry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/api/registry.py b/metadata-ingestion/src/datahub/ingestion/api/registry.py index 6b50e0b8a8a5d4..5e372a964c7e6c 100644 --- a/metadata-ingestion/src/datahub/ingestion/api/registry.py +++ b/metadata-ingestion/src/datahub/ingestion/api/registry.py @@ -173,8 +173,10 @@ def get(self, key: str) -> Type[T]: tp = self._ensure_not_lazy(key) if isinstance(tp, ModuleNotFoundError): + # TODO: Once we're on Python 3.11 (with PEP 678), we can use .add_note() + # to enrich the error instead of wrapping it. raise ConfigurationError( - f"{key} is disabled; try running: pip install '{__package_name__}[{key}]'" + f"{key} is disabled due to a missing dependency: {tp.name}; try running `pip install '{__package_name__}[{key}]'`" ) from tp elif isinstance(tp, Exception): raise ConfigurationError(