From 45cf1354fc05342951c087a8a2d1e8db3e9e42ff Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Wed, 21 May 2025 11:24:23 +0330 Subject: [PATCH] feat: add environment variable loading in S3Client initialization --- hivemind_etl/storage/s3_client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hivemind_etl/storage/s3_client.py b/hivemind_etl/storage/s3_client.py index 941972a..2a4fdb2 100644 --- a/hivemind_etl/storage/s3_client.py +++ b/hivemind_etl/storage/s3_client.py @@ -8,10 +8,15 @@ from botocore.config import Config from botocore.exceptions import ClientError from llama_index.core import Document +from dotenv import load_dotenv class S3Client: def __init__(self): + loaded = load_dotenv() + if not loaded: + raise ValueError("Failed to load environment variables") + # Get AWS S3 environment variables self.endpoint_url = os.getenv("AWS_ENDPOINT_URL") self.access_key = os.getenv("AWS_ACCESS_KEY_ID")