druid-io / pydruid

A Python connector for Druid
Other
505 stars 194 forks source link

Version 0.6.3 is broken if you don't already have sqlalchemy installed #286

Open scottbelden opened 2 years ago

scottbelden commented 2 years ago

With a fresh python environment, if you do pip install pydruid and then do python -c "from pydruid.db import connect" you get ModuleNotFoundError: No module named 'sqlalchemy'.

This is because sqlalchemy is not a required dependency (only an extra): https://github.com/druid-io/pydruid/blob/893506b5acdf90eb3438f108e46ffd77288a530b/setup.py#L7-L12

However, pydruid.db.exceptions does an import of it without checking if it is installed: https://github.com/druid-io/pydruid/blob/893506b5acdf90eb3438f108e46ffd77288a530b/pydruid/db/exceptions.py#L1