From 6c5006f6c2602a8576adcd0badbf846eaadbff49 Mon Sep 17 00:00:00 2001 From: Julien Bardonnet Date: Sat, 23 Jul 2022 12:41:30 +0200 Subject: [PATCH] Python API: fix ee.data.create_assets() when recursively creating parents --- python/ee/data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/ee/data.py b/python/ee/data.py index a9e2bf4a9..7e045e769 100644 --- a/python/ee/data.py +++ b/python/ee/data.py @@ -2026,10 +2026,10 @@ def create_assets( continue if mk_parents: parts = asset_id.split('/') - # We don't need to create the namespace and the user's/project's folder. - if len(parts) > 2: - path = parts[0] + '/' + parts[1] + '/' - for part in parts[2:-1]: + # skip the base folder "projects//assets/" + if len(parts) > 3: + path = '/'.join(parts[:3]) + '/' + for part in parts[3:-1]: path += part if getInfo(path) is None: createAsset({'type': ASSET_TYPE_FOLDER_CLOUD}, path)