Skip to content

Fix: get metadata conf - #14250

Merged
JinHai-CN merged 4 commits into
infiniflow:mainfrom
Lynn-Inf:fix/auto-metadata
Apr 21, 2026
Merged

JinHai-CN merged 4 commits into
infiniflow:mainfrom
Lynn-Inf:fix/auto-metadata

Conversation

@Lynn-Inf

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Get metadata configuration from union of custom metadata and built_in_metadata.

Type of change

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

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 21, 2026
@Lynn-Inf Lynn-Inf added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Apr 21, 2026
@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb32bab2-4272-4cf2-af14-8627ab3fda0c

📥 Commits

Reviewing files that changed from the base of the PR and between e2aaa06 and 3a9b7b5.

📒 Files selected for processing (1)
  • rag/svr/task_executor.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • rag/svr/task_executor.py

📝 Walkthrough

Walkthrough

Metadata generation in rag/svr/task_executor.py now triggers when either parser_config["metadata"] or parser_config["built_in_metadata"] is present (still requiring enable_metadata). The two sources are merged into metadata_conf, which is passed to cache operations and turn2jsonschema.

Changes

Cohort / File(s) Summary
Metadata Gating & Merge
rag/svr/task_executor.py
Gating updated to check for parser_config["metadata"] OR parser_config["built_in_metadata"] (with enable_metadata). Introduced metadata_conf = merged metadata (default []) + built_in_metadata (default []). Cache reads/writes for task "metadata" use metadata_conf; turn2jsonschema is called with metadata_conf.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

size:XS

Poem

🐰 I nibble through configs with curious cheer,
Merging built-in and custom both near,
Metadata dances, no longer apart,
Cache and schema hum in one heart,
A tiny hop for cleaner art.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and uses generic phrasing ('get metadata conf') that doesn't clearly convey what the fix addresses or why it matters. Improve the title to be more specific about the fix, e.g., 'Fix: merge custom and built-in metadata configurations' or 'Fix: include built_in_metadata in metadata configuration union'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the required template structure with the problem statement and type of change clearly marked, though the problem statement itself is somewhat terse.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Lynn-Inf
Lynn-Inf marked this pull request as draft April 21, 2026 06:41
@Lynn-Inf
Lynn-Inf marked this pull request as ready for review April 21, 2026 06:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rag/svr/task_executor.py`:
- Around line 417-418: The code mutates task["parser_config"]["metadata"]
in-place by calling metadata_conf.extend(...), causing duplicated
built_in_metadata across chunks and cache/hash issues; fix by creating a fresh
list copy per call (e.g., metadata_conf =
list(task["parser_config"].get("metadata") or []) +
list(task["parser_config"].get("built_in_metadata") or [])) instead of extend,
and consider hoisting this computation out of gen_metadata_task so it runs once
per task; ensure you guard against None with "or []" so you never call extend or
plus with None (affecting functions like turn2jsonschema and get_llm_cache).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9842107-f901-4094-9192-d50b0cfe4b29

📥 Commits

Reviewing files that changed from the base of the PR and between 78b800e and e2aaa06.

📒 Files selected for processing (1)
  • rag/svr/task_executor.py

Comment thread rag/svr/task_executor.py Resolved
@codecov

codecov Bot commented Apr 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.66%. Comparing base (a2bea30) to head (3a9b7b5).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14250   +/-   ##
=======================================
  Coverage   96.66%   96.66%           
=======================================
  Files          10       10           
  Lines         690      690           
  Branches      108      108           
=======================================
  Hits          667      667           
  Misses          8        8           
  Partials       15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 21, 2026
@JinHai-CN
JinHai-CN merged commit afdf081 into infiniflow:main Apr 21, 2026
1 check passed
JasleenKaurSethi pushed a commit to stackhpc/ragflow that referenced this pull request Apr 28, 2026
### What problem does this PR solve?

Get metadata configuration from union of custom metadata and
built_in_metadata.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
@coderabbitai coderabbitai Bot mentioned this pull request Apr 29, 2026
1 task done
@coderabbitai coderabbitai Bot mentioned this pull request May 26, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants