Skip to content

Commit

Permalink
perf(imports): speed up checking for geospatial support
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jun 12, 2023
1 parent 98a0fa1 commit aa601af
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ibis/backends/base/sql/alchemy/geospatial.py
@@ -1,10 +1,8 @@
from __future__ import annotations

try:
import geoalchemy2
import geoalchemy2.shape # noqa: F401
import geopandas # noqa: F401
except ImportError:
geospatial_supported = False
else:
geospatial_supported = True
from importlib.util import find_spec as _find_spec

geospatial_supported = (
_find_spec("geoalchemy2") is not None and _find_spec("geopandas") is not None
)
__all__ = ["geospatial_supported"]

0 comments on commit aa601af

Please sign in to comment.