Skip to content

Commit

Permalink
Add error message for when if DATATOOLS_S3ROOT is None:
Browse files Browse the repository at this point in the history
  • Loading branch information
tfurmston committed Jul 25, 2023
1 parent ec8fd6c commit b89cae6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions metaflow/plugins/datatools/s3/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@ class S3(object):

@classmethod
def get_root_from_config(cls, echo, create_on_absent=True):
if DATATOOLS_S3ROOT is None:
raise MetaflowS3URLException(
"DATATOOLS_S3ROOT is not configured when trying to use S3 storage"
)
return DATATOOLS_S3ROOT

def __init__(
Expand All @@ -512,6 +516,10 @@ def __init__(

if run:
# 1. use a (current) run ID with optional customizations
if DATATOOLS_S3ROOT is None:
raise MetaflowS3URLException(
"DATATOOLS_S3ROOT is not configured when trying to use S3 storage"
)
parsed = urlparse(DATATOOLS_S3ROOT)
if not bucket:
bucket = parsed.netloc
Expand Down

0 comments on commit b89cae6

Please sign in to comment.