villebro commented on a change in pull request #7643: 7620: Start removing dependencies on requests URL: https://github.com/apache/incubator-superset/pull/7643#discussion_r298262180
########## File path: superset/connectors/druid/models.py ########## @@ -31,20 +31,26 @@ from flask_appbuilder.models.decorators import renders from flask_babel import lazy_gettext as _ import pandas -from pydruid.client import PyDruid -from pydruid.utils.aggregators import count -from pydruid.utils.dimensions import MapLookupExtraction, RegexExtraction -from pydruid.utils.filters import Dimension, Filter -from pydruid.utils.having import Aggregation -from pydruid.utils.postaggregator import ( - Const, - Field, - HyperUniqueCardinality, - Postaggregator, - Quantile, - Quantiles, -) -import requests +try: + from pydruid.client import PyDruid + from pydruid.utils.aggregators import count + from pydruid.utils.dimensions import MapLookupExtraction, RegexExtraction + from pydruid.utils.filters import Dimension, Filter + from pydruid.utils.having import Aggregation + from pydruid.utils.postaggregator import ( + Const, + Field, + HyperUniqueCardinality, + Postaggregator, + Quantile, + Quantiles, + ) + import requests +except ImportError: Review comment: It would probably be good to use either `ImportError` or `ModuleNotFoundError` everywhere? As `ModuleNotFoundError` is a child of `ImportError` and thus more precise, I would opt for that. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
