Skip to content

Commit

Permalink
Only import from utils.aws. when requested (#1172)
Browse files Browse the repository at this point in the history
boto is not a default dependency, so should not be imported at module level
without import guards
  • Loading branch information
Kirill888 authored and omad committed Aug 11, 2021
1 parent 9379710 commit 31f8e56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datacube/drivers/postgres/_connections.py
Expand Up @@ -27,7 +27,6 @@
import datacube
from datacube.index.exceptions import IndexSetupError
from datacube.utils import jsonify_document
from datacube.utils.aws import obtain_new_iam_auth_token

from . import _api
from . import _core
Expand Down Expand Up @@ -136,6 +135,7 @@ def _create_engine(url, application_name=None, iam_rds_auth=False, iam_rds_timeo
)

if iam_rds_auth:
from datacube.utils.aws import obtain_new_iam_auth_token
handle_dynamic_token_authentication(engine, obtain_new_iam_auth_token, timeout=iam_rds_timeout, url=url)

return engine
Expand Down

0 comments on commit 31f8e56

Please sign in to comment.