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

community[patch]: Fix NotionDBLoader 400 Error by conditionally adding filter parameter #19075

Merged
merged 1 commit into from Mar 14, 2024

Conversation

gunnzolder
Copy link
Contributor

  • Description: This change fixes a bug where attempts to load data from Notion using the NotionDBLoader resulted in a 400 Bad Request error. The issue was traced to the unconditional addition of an empty 'filter' object in the request payload, which Notion's API does not accept. The modification ensures that the 'filter' object is only included in the payload when it is explicitly provided and not empty, thus preventing the 400 error from occurring.
  • Issue: Fixes #18009
  • Dependencies: None
  • Twitter handle: @gunnzolder

Modified _request method in langchain/libs/community/langchain_community/document_loaders/notiondb.py to conditionally include the 'filter' key in the JSON payload only if the filter_object is provided and not empty.

Related GitHub Issue: langchain-ai#18009
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 14, 2024
Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 14, 2024 1:46pm

@dosubot dosubot bot added Ɑ: doc loader Related to document loader module (not documentation) 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Mar 14, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Mar 14, 2024
@eyurtsev eyurtsev changed the title community: Fix NotionDBLoader 400 Error by conditionally adding filter parameter community[patch]: Fix NotionDBLoader 400 Error by conditionally adding filter parameter Mar 14, 2024
@eyurtsev eyurtsev enabled auto-merge (squash) March 14, 2024 13:51
@eyurtsev eyurtsev merged commit ae73b9d into langchain-ai:master Mar 14, 2024
59 checks passed
@gunnzolder gunnzolder deleted the fix-notiondb-400-error branch March 14, 2024 13:57
rahul-trip pushed a commit to daxa-ai/langchain that referenced this pull request Mar 27, 2024
…g filter parameter (langchain-ai#19075)

- **Description:** This change fixes a bug where attempts to load data
from Notion using the NotionDBLoader resulted in a 400 Bad Request
error. The issue was traced to the unconditional addition of an empty
'filter' object in the request payload, which Notion's API does not
accept. The modification ensures that the 'filter' object is only
included in the payload when it is explicitly provided and not empty,
thus preventing the 400 error from occurring.
- **Issue:** Fixes
[langchain-ai#18009](langchain-ai#18009)
- **Dependencies:** None
- **Twitter handle:** @gunnzolder

Co-authored-by: Anton Parkhomenko <anton@merge.rocks>
bechbd pushed a commit to bechbd/langchain that referenced this pull request Mar 29, 2024
…g filter parameter (langchain-ai#19075)

- **Description:** This change fixes a bug where attempts to load data
from Notion using the NotionDBLoader resulted in a 400 Bad Request
error. The issue was traced to the unconditional addition of an empty
'filter' object in the request payload, which Notion's API does not
accept. The modification ensures that the 'filter' object is only
included in the payload when it is explicitly provided and not empty,
thus preventing the 400 error from occurring.
- **Issue:** Fixes
[langchain-ai#18009](langchain-ai#18009)
- **Dependencies:** None
- **Twitter handle:** @gunnzolder

Co-authored-by: Anton Parkhomenko <anton@merge.rocks>
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
…g filter parameter (langchain-ai#19075)

- **Description:** This change fixes a bug where attempts to load data
from Notion using the NotionDBLoader resulted in a 400 Bad Request
error. The issue was traced to the unconditional addition of an empty
'filter' object in the request payload, which Notion's API does not
accept. The modification ensures that the 'filter' object is only
included in the payload when it is explicitly provided and not empty,
thus preventing the 400 error from occurring.
- **Issue:** Fixes
[langchain-ai#18009](langchain-ai#18009)
- **Dependencies:** None
- **Twitter handle:** @gunnzolder

Co-authored-by: Anton Parkhomenko <anton@merge.rocks>
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
…g filter parameter (#19075)

- **Description:** This change fixes a bug where attempts to load data
from Notion using the NotionDBLoader resulted in a 400 Bad Request
error. The issue was traced to the unconditional addition of an empty
'filter' object in the request payload, which Notion's API does not
accept. The modification ensures that the 'filter' object is only
included in the payload when it is explicitly provided and not empty,
thus preventing the 400 error from occurring.
- **Issue:** Fixes
[#18009](#18009)
- **Dependencies:** None
- **Twitter handle:** @gunnzolder

Co-authored-by: Anton Parkhomenko <anton@merge.rocks>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature Ɑ: doc loader Related to document loader module (not documentation) lgtm PR looks good. Use to confirm that a PR is ready for merging. size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
2 participants