-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
SharePointLoader: Pydantic Validation Error in _O365Settings Due to Extra Fields in .env File #26850
Closed
5 tasks done
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Comments
dosubot
bot
added
the
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
label
Sep 25, 2024
I have identified the solution to the issue. However, I believe this problem is prevalent across multiple Langchain modules wherever |
eyurtsev
pushed a commit
that referenced
this issue
Sep 25, 2024
…ultiple Langchain modules (#26852) - **Description:** This pull request addresses the validation error in `SettingsConfigDict` due to extra fields in the `.env` file. The issue is prevalent across multiple Langchain modules. This fix ensures that extra fields in the `.env` file are ignored, preventing validation errors. **Changes include:** - Applied fixes to modules using `SettingsConfigDict`. - **Issue:** NA, similar #26850 - **Dependencies:** NA
Sheepsta300
pushed a commit
to Sheepsta300/langchain
that referenced
this issue
Oct 1, 2024
…tings due to extra fields in .env file (langchain-ai#26851) **Description:** Fix validation error in _O365Settings by ignoring extra fields in .env file **Issue:** langchain-ai#26850 **Dependencies:** NA
Sheepsta300
pushed a commit
to Sheepsta300/langchain
that referenced
this issue
Oct 1, 2024
…ultiple Langchain modules (langchain-ai#26852) - **Description:** This pull request addresses the validation error in `SettingsConfigDict` due to extra fields in the `.env` file. The issue is prevalent across multiple Langchain modules. This fix ensures that extra fields in the `.env` file are ignored, preventing validation errors. **Changes include:** - Applied fixes to modules using `SettingsConfigDict`. - **Issue:** NA, similar langchain-ai#26850 - **Dependencies:** NA
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checked other resources
Example Code
from langchain_community.document_loaders import SharePointLoader
sp_loader = SharePointLoader(
document_library_id="drive-id",
)
docs = sp_loader.load()
Error Message and Stack Trace (if applicable)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for _O365Settings
openai_api_key
Extra inputs are not permitted [type=extra_forbidden, input_value='sk-proj-AwsD-exKM2Mq-p4W...mSSZU1xSCpf8O022nVA3tIA', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/extra_forbidden
pg_connection_string
Extra inputs are not permitted [type=extra_forbidden, input_value='postgresql://postgres:xxxxxxxx/postgres', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/extra_forbidden
Description
I am encountering a
pydantic_core._pydantic_core.ValidationError
when trying to use theSharePointLoader
, which internally loads_O365Settings
from the.env
file. The error indicates that extra inputs are not permitted, causing the validation to fail.The issue appears to be due to additional fields (
openai_api_key
andpg_connection_string
) in the.env
file that are not defined in the_O365Settings
class. This results in the validation failing with theextra_forbidden
error type.My
.env
file looks like:System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: