From b89cae6163f422480a35a6c94b277fff3faee171 Mon Sep 17 00:00:00 2001 From: tfurmston Date: Tue, 25 Jul 2023 21:32:41 +0100 Subject: [PATCH] Add error message for when if DATATOOLS_S3ROOT is None: --- metaflow/plugins/datatools/s3/s3.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/metaflow/plugins/datatools/s3/s3.py b/metaflow/plugins/datatools/s3/s3.py index aae53fb7be3..67224efc78b 100644 --- a/metaflow/plugins/datatools/s3/s3.py +++ b/metaflow/plugins/datatools/s3/s3.py @@ -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__( @@ -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