Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use recursive strategy by default for SharePoint #12557

Merged
merged 1 commit into from
Apr 4, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## [0.1.7] - 2024-04-03

- Use recursive strategy by default for reading from a folder

## [0.1.6] - 2024-04-01

- Allow passing arguments for sitename and folder path during construction of reader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def _download_files_from_sharepoint(

self._drive_id = self._get_drive_id()

if sharepoint_folder_id is None:
if not sharepoint_folder_id:
sharepoint_folder_id = self._get_sharepoint_folder_id(
sharepoint_folder_path
)
Expand Down Expand Up @@ -378,7 +378,7 @@ def load_data(
sharepoint_site_name: Optional[str] = None,
sharepoint_folder_path: Optional[str] = None,
sharepoint_folder_id: Optional[str] = None,
recursive: bool = False,
recursive: bool = True,
) -> List[Document]:
"""
Loads the files from the specified folder in the SharePoint site.
Expand All @@ -395,20 +395,20 @@ def load_data(
Exception: If an error occurs while accessing SharePoint site.
"""
# If no arguments are provided to load_data, default to the object attributes
if sharepoint_site_name is None:
if not sharepoint_site_name:
sharepoint_site_name = self.sharepoint_site_name

if sharepoint_folder_path is None:
if not sharepoint_folder_path:
sharepoint_folder_path = self.sharepoint_folder_path

if sharepoint_folder_id is None:
if not sharepoint_folder_id:
sharepoint_folder_id = self.sharepoint_folder_id

# TODO: make both of these values optional — and just default to the client ID defaults
if sharepoint_site_name is None:
if not sharepoint_site_name:
raise ValueError("sharepoint_site_name must be provided.")

if sharepoint_folder_path is None and sharepoint_folder_id is None:
if not sharepoint_folder_path and not sharepoint_folder_id:
raise ValueError(
"sharepoint_folder_path or sharepoint_folder_id must be provided."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ license = "MIT"
maintainers = ["arun-soliton"]
name = "llama-index-readers-microsoft-sharepoint"
readme = "README.md"
version = "0.1.6"
version = "0.1.7"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down
Loading