Skip to content
Snippets Groups Projects
Unverified Commit 0ed1ac6d authored by Kurtis Massey's avatar Kurtis Massey
Browse files

Update docstring for get_env_variable

parent a080de4b
No related branches found
No related tags found
No related merge requests found
......@@ -250,6 +250,20 @@ class BedrockEncoder(BaseEncoder):
@staticmethod
def get_env_variable(var_name, provided_value, default=None):
"""Retrieves environment variable or uses a provided value.
Args:
var_name (str): The name of the environment variable.
provided_value (Optional[str]): The provided value to use if not None.
default (Optional[str]): The default value if the environment variable is not set.
Returns:
str: The value of the environment variable or the provided/default value.
None: Where AWS_SESSION_TOKEN is not set or provided
Raises:
ValueError: If no value is provided and the environment variable is not set.
"""
if provided_value is not None:
return provided_value
value = os.getenv(var_name, default)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment