Skip to content

fix: set _drive_id_endpoint before early return in SharePointReader._get_drive_id#20837

Open
Br1an67 wants to merge 1 commit intorun-llama:mainfrom
Br1an67:fix/issue-18753-drive-id-endpoint
Open

fix: set _drive_id_endpoint before early return in SharePointReader._get_drive_id#20837
Br1an67 wants to merge 1 commit intorun-llama:mainfrom
Br1an67:fix/issue-18753-drive-id-endpoint

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Description

When drive_id is provided directly to SharePointReader, _get_drive_id() returned early without setting _drive_id_endpoint, causing AttributeError in downstream methods like _get_sharepoint_folder_id, _get_permissions_info, _list_folder_contents, and _list_drive_contents.

Moved the _drive_id_endpoint assignment before the early return checks so it is always set regardless of how the drive ID is resolved.

Fixes #18753

New Package?

  • No

Version Bump?

  • Yes — llama-index-readers-microsoft-sharepoint bumped from 0.8.00.8.1

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • I added new unit tests to cover this change

Added test_drive_id_endpoint_set_when_drive_id_provided which verifies that _drive_id_endpoint is properly set when drive_id is provided directly.

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran uv run make format; uv run make lint to appease the lint gods

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 1, 2026
Copy link
Member

@AstraBert AstraBert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to bump the version of the integration for it to be published

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 2, 2026
…get_drive_id

When drive_id is provided directly to SharePointReader, _get_drive_id()
returned early without setting _drive_id_endpoint, causing AttributeError
in downstream methods like _get_sharepoint_folder_id, _get_permissions_info,
_list_folder_contents, and _list_drive_contents.

Moved the _drive_id_endpoint assignment before the early return checks so
it is always set regardless of how the drive ID is resolved.

Bump llama-index-readers-microsoft-sharepoint version to 0.8.1.
@Br1an67 Br1an67 force-pushed the fix/issue-18753-drive-id-endpoint branch from c322bba to b4fca42 Compare March 2, 2026 14:51
@Br1an67
Copy link
Author

Br1an67 commented Mar 2, 2026

Thanks for the review! Bumped llama-index-readers-microsoft-sharepoint from 0.8.00.8.1 in both pyproject.toml and uv.lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SharepointReader object has no attribute _drive_id_endpoint

2 participants