def validate_structured_asset_key(l): if len(l) == 0: raise DagsterInvalidAssetKey() for s in l: validate_asset_key_string(s) return l
def validate_asset_key_string(s): if not s or not ASSET_KEY_REGEX.match(s): raise DagsterInvalidAssetKey() return s