Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [Version 1.1.7](https://github.com/dataiku/dss-plugin-sharepoint-online/releases/tag/v1.1.7) - Bugfix release - 2025-05-14

- Add recursive folder deletion

## [Version 1.1.6](https://github.com/dataiku/dss-plugin-sharepoint-online/releases/tag/v1.1.6) - Bugfix release - 2025-04-01

- Fix issue with 255+ chars file paths. The new limit is 400 chars, imposed by SharePoint's API.
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "sharepoint-online",
"version": "1.1.6",
"version": "1.1.7",
"meta": {
"label": "SharePoint Online",
"description": "Read and write data from/to your SharePoint Online account",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,36 @@ def delete_recursive(self, path):
return 1

if folder is not None:
file_count = self.delete(get_lnt_path(full_path))
logger.info("deleting folder '{}'".format(get_lnt_path(full_path)))
self.client.recycle_folder(get_lnt_path(full_path))
return 1
return file_count

return 0

def delete(self, path, file_count=0):
# logger.info("call delete '{}'".format(path))
files = self.client.get_files(path)
files = self.client.extract_results(files)
for file in files:
file_name = file.get("Name")
if file_name:
file_path = "/".join([path, file_name])
logger.info("deleting file '{}'".format(get_lnt_path(file_path)))
self.client.recycle_file(get_lnt_path(file_path))
file_count += 1
folders = self.client.get_folders(path)
folders = self.client.extract_results(folders)
for folder in folders:
folder_name = folder.get("Name")
if folder_name:
folder_path = "/".join([path, folder_name])
# logger.info("deleting content of folder '{}'".format(get_lnt_path(folder_path)))
file_count = self.delete(get_lnt_path(folder_path), file_count)
logger.info("deleting folder '{}'".format(get_lnt_path(folder_path)))
self.client.recycle_folder(get_lnt_path(folder_path))
return file_count

def move(self, from_path, to_path):
assert_valid_sharepoint_path(from_path)
assert_no_percent_in_path(from_path)
Expand Down
2 changes: 1 addition & 1 deletion python-lib/dss_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DSSConstants(object):
"sharepoint_oauth": "The access token is missing"
}
PATH = 'path'
PLUGIN_VERSION = "1.1.6"
PLUGIN_VERSION = "1.1.7-beta.1"
SECRET_PARAMETERS_KEYS = ["Authorization", "sharepoint_username", "sharepoint_password", "client_secret", "client_certificate", "passphrase"]
SITE_APP_DETAILS = {
"sharepoint_tenant": "The tenant name is missing",
Expand Down
3 changes: 1 addition & 2 deletions python-lib/sharepoint_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,7 @@ def get_list_default_view_url(self, list_title):
)

def get_path_as_query_string(self, path):
if path:
if path == '/':
if path is None or path == '/':
path = ""
return "?@a1='{}'".format(
url_encode(self.get_site_path(path))
Expand Down