Skip to content

Commit 408bdf6

Browse files
authored
Merge pull request #45 from TogetherCrew/feat/43-mediawiki-activities-limit
feat: add environment variable loading in S3Client initialization
2 parents 7bb6ef5 + 45cf135 commit 408bdf6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hivemind_etl/storage/s3_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
from botocore.config import Config
99
from botocore.exceptions import ClientError
1010
from llama_index.core import Document
11+
from dotenv import load_dotenv
1112

1213

1314
class S3Client:
1415
def __init__(self):
16+
loaded = load_dotenv()
17+
if not loaded:
18+
raise ValueError("Failed to load environment variables")
19+
1520
# Get AWS S3 environment variables
1621
self.endpoint_url = os.getenv("AWS_ENDPOINT_URL")
1722
self.access_key = os.getenv("AWS_ACCESS_KEY_ID")

0 commit comments

Comments
 (0)