diff --git a/pyproject.toml b/pyproject.toml index 5c58cf1..7d86bc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ requires-python = ">=3.8" dependencies = [ "deprecated>=1.2.14", - "earthengine-api", + "earthengine-api>=0.1.397", # new ee.data.createFolder method "pytest", ] diff --git a/pytest_gee/utils.py b/pytest_gee/utils.py index 84033aa..0485906 100644 --- a/pytest_gee/utils.py +++ b/pytest_gee/utils.py @@ -153,7 +153,7 @@ def _recursive_create(structure, prefix, folder): asset_id = PurePosixPath(folder) / name description = f"{prefix}_{name}" if isinstance(content, dict): - ee.data.createAsset({"type": "FOLDER"}, str(asset_id)) + ee.data.createFolder(str(asset_id)) _recursive_create(content, prefix, asset_id) else: export_asset(content, asset_id, description) @@ -161,7 +161,7 @@ def _recursive_create(structure, prefix, folder): # create the root folder root = PurePosixPath(root) if isinstance(root, str) else root root_folder = f"{root.as_posix()}/{prefix}" - ee.data.createAsset({"type": "FOLDER"}, root_folder) + ee.data.createFolder(root_folder) # start the recursive function _recursive_create(structure, prefix, root_folder)