[PR #2321] [MERGED] Fix/notion query database filter #2400

Closed
opened 2026-02-16 11:16:52 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/2321
Author: @Kota-Maeda
Created: 12/24/2025
Status: Merged
Merged: 12/24/2025
Merged by: @crazywoola

Base: mainHead: fix/notion-query-database-filter


📝 Commits (2)

  • 67c90a8 fix(notion): Fix filter bug for title properties and add status/relation support
  • 317d466 chore: bump version to 0.0.3

📊 Changes

2 files changed (+35 additions, -3 deletions)

View changed files

📝 tools/notion/manifest.yaml (+1 -1)
📝 tools/notion/tools/query_database.py (+34 -2)

📄 Description

Related Issues or Context

Fixes #2320
Resolves #1848

This PR fixes two critical bugs in the Notion query_database tool:

  1. Filter Bug (#2320): Filters not working on title properties because the tool always created rich_text type filters
  2. Property Extraction Bug (#1848): Status and relation properties returning <status> and <relation> placeholders instead of actual values

Technical Details

Filter Fix:

  • Retrieves database schema before creating filters to determine the actual property type
  • Creates appropriate filter based on property type:
    • Title properties: {"property": "Name", "title": {"equals": "value"}}
    • Rich text properties: {"property": "Description", "rich_text": {"equals": "value"}}

Property Extraction Fix:

  • Status properties: Extracts status.name from API response
  • Relation properties: Extracts list of id values from relation array

This PR contains Changes to Non-Plugin

  • Documentation
  • Other

This PR contains Changes to Non-LLM Models Plugin

  • I have Run Comprehensive Tests Relevant to My Changes

This PR contains Changes to LLM Models Plugin

  • My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking)
  • My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node)
  • My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.)
  • My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.)
  • My Changes Affect Structured Output Format (JSON, XML, etc.)
  • My Changes Affect Token Consumption Metrics
  • My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.)

Version Control

  • I have Bumped Up the Version in Manifest.yaml

Version bumped from 0.0.2 to 0.0.3 (PATCH version for backward-compatible bug fixes)

Dify Plugin SDK Version

  • I have Ensured dify_plugin>=0.3.0,<0.6.0 is in requirements.txt

Environment Verification

Local Deployment Environment

  • Dify Version is: 1.10.1, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration.

SaaS Environment

  • I have Tested My Changes on cloud.dify.ai

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-official-plugins/pull/2321 **Author:** [@Kota-Maeda](https://github.com/Kota-Maeda) **Created:** 12/24/2025 **Status:** ✅ Merged **Merged:** 12/24/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `fix/notion-query-database-filter` --- ### 📝 Commits (2) - [`67c90a8`](https://github.com/langgenius/dify-official-plugins/commit/67c90a82ab20ee369ee85b6f055fa3c130e4b83c) fix(notion): Fix filter bug for title properties and add status/relation support - [`317d466`](https://github.com/langgenius/dify-official-plugins/commit/317d46661d13958e9111ac4b24fb12d3713a089a) chore: bump version to 0.0.3 ### 📊 Changes **2 files changed** (+35 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tools/notion/manifest.yaml` (+1 -1) 📝 `tools/notion/tools/query_database.py` (+34 -2) </details> ### 📄 Description ## Related Issues or Context Fixes #2320 Resolves #1848 This PR fixes two critical bugs in the Notion `query_database` tool: 1. **Filter Bug (#2320)**: Filters not working on title properties because the tool always created `rich_text` type filters 2. **Property Extraction Bug (#1848)**: Status and relation properties returning `<status>` and `<relation>` placeholders instead of actual values ### Technical Details **Filter Fix**: - Retrieves database schema before creating filters to determine the actual property type - Creates appropriate filter based on property type: - Title properties: `{"property": "Name", "title": {"equals": "value"}}` - Rich text properties: `{"property": "Description", "rich_text": {"equals": "value"}}` **Property Extraction Fix**: - Status properties: Extracts `status.name` from API response - Relation properties: Extracts list of `id` values from relation array ## This PR contains Changes to *Non-Plugin* - [ ] Documentation - [ ] Other ## This PR contains Changes to *Non-LLM Models Plugin* - [x] I have Run Comprehensive Tests Relevant to My Changes ## This PR contains Changes to LLM Models Plugin - [ ] My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking) - [ ] My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node) - [ ] My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.) - [ ] My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.) - [ ] My Changes Affect Structured Output Format (JSON, XML, etc.) - [ ] My Changes Affect Token Consumption Metrics - [ ] My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.) ## Version Control - [x] I have Bumped Up the Version in Manifest.yaml Version bumped from 0.0.2 to 0.0.3 (PATCH version for backward-compatible bug fixes) ## Dify Plugin SDK Version - [x] I have Ensured `dify_plugin>=0.3.0,<0.6.0` is in requirements.txt ## Environment Verification ### Local Deployment Environment - [x] Dify Version is: 1.10.1, I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration. ### SaaS Environment - [ ] I have Tested My Changes on cloud.dify.ai --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 11:16:52 -05:00
yindo closed this issue 2026-02-16 11:16:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#2400