From 202d063f97d667815cf1878310a793c0ffc739f7 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 91f76e1b9..88de39a5c 100644 --- a/python/ee/data.py +++ b/python/ee/data.py @@ -1733,10 +1733,10 @@ def create_assets(asset_ids, asset_type, mk_parents): 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)