Skip to content

Commit d82f636

Browse files
fix(aws_dms): make boto3 import lazy so other components can load without it
The lazy-loader in dagster_community_components/__init__.py imports every component's module when dg discovers plugins — if aws_dms fails to import because boto3 isn't installed, the whole discovery fails and every unrelated component breaks. Guard the boto3/botocore imports so aws_dms module loads cleanly; the actual client construction (which does need boto3) happens inside methods and raises with a clear message if it's missing. Surfaced by the qlik_replicate demo — dg check failed on ModuleNotFoundError for boto3 during plugin discovery even though the demo doesn't use aws_dms.
1 parent 2ae6d19 commit d82f636

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

integrations/aws_dms/component.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
from typing import Optional, List, Dict, Any
1111
from datetime import datetime, timedelta
1212

13-
import boto3
14-
from botocore.exceptions import ClientError
13+
try:
14+
import boto3
15+
from botocore.exceptions import ClientError
16+
except ImportError:
17+
boto3 = None # type: ignore[assignment]
18+
ClientError = Exception # type: ignore[assignment,misc]
1519

1620
from dagster import (
1721
Component,

0 commit comments

Comments
 (0)