-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rdrp 1015 s3 config: s3 parameters are now read from the dev config, not hardcoded. #353
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
A class that initialises a single instance of boto3 client | ||
""" | ||
import boto3 | ||
import raz_client | ||
|
||
|
||
class SingletonConfig: | ||
_instance = None | ||
|
||
def __init__(self): | ||
raise RuntimeError("This is a Singleton, invoke get_config() instead.") | ||
|
||
|
||
@classmethod | ||
def get_config(cls, config={}): # , bucket_str= None): | ||
if cls._instance is None: | ||
Bucket=config["s3"]["s3_bucket"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain why Bucket has a capital, and why it shows as a different colour here? |
||
cls._instance = Bucket | ||
return cls._instance | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm really impressed you got this to work ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi George, I've corrected this, but it looks like you've put it back to how it was before. I suggest we have 2022 data for 2023 imputation, not 2021.