Skip to content

Fix [Bug]: Save parser configs in dataset configuration page is not working #15175 - #15177

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
mustangxu:15175
May 26, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
mustangxu:15175

Conversation

@mustangxu

@mustangxu mustangxu commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Fix [Bug]: Save parser configs in dataset configuration page is not working #15175

Type of change

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

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 24, 2026
@coderabbitai

coderabbitai Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR modifies CreateDatasetReq.validate_avatar_base64 in api/utils/validation_utils.py to treat any falsy value (None and empty string) as an early return case, replacing the prior check that only detected None.

Changes

Avatar validation

Layer / File(s) Summary
Avatar base64 falsy value handling
api/utils/validation_utils.py
validate_avatar_base64 now returns early for any falsy value (including empty strings), not only None, via changed condition from v is None to if not v.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Poem

🐰 A rabbit hops through validation code,
Where empty strings now take the early load,
No mime-less ghosts shall pass today—
Falsy values find their way! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal and lacks critical details about the implementation and testing. Provide more context: explain what specifically was broken in the validation logic, why checking if not v instead of if v is None fixes the bug, what edge cases are now handled, and describe testing performed to verify the fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the bug being fixed (#15175) and clearly indicates this is a bug fix for a dataset configuration feature.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

@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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/utils/validation_utils.py`:
- Around line 560-561: The current check "if not v: return v" in
validation_utils.py returns empty strings as-is which causes empty avatar to be
persisted; change this branch to explicitly normalize empty string to None
(i.e., if v is None or v == "" return None) so empty avatars are treated as
unset, and add a debug/info log entry (using the module logger) indicating an
avatar value was normalized to None to satisfy the "*.py logging" guideline;
update references to the symbol v and the surrounding validation function so
callers receive None instead of "".
🪄 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: ba542ecd-5492-44cc-be86-01ad4cfeaa54

📥 Commits

Reviewing files that changed from the base of the PR and between e6dd397 and 9d022a3.

📒 Files selected for processing (1)
  • api/utils/validation_utils.py

Comment on lines +560 to 561
if not v: # cover both None and empty string
return v

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize empty avatar to None instead of persisting empty string.

This branch currently returns "" unchanged, and that value flows into dataset creation/persistence. Treating empty avatar as None avoids inconsistent “unset” representations downstream.

Suggested fix
-        if not v: # cover both None and empty string
-            return v
+        if not v:  # cover both None and empty string
+            return None

As per coding guidelines, "**/*.py: Add logging for new flows" and this new flow should keep behavior explicit and consistent in backend request handling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/utils/validation_utils.py` around lines 560 - 561, The current check "if
not v: return v" in validation_utils.py returns empty strings as-is which causes
empty avatar to be persisted; change this branch to explicitly normalize empty
string to None (i.e., if v is None or v == "" return None) so empty avatars are
treated as unset, and add a debug/info log entry (using the module logger)
indicating an avatar value was normalized to None to satisfy the "*.py logging"
guideline; update references to the symbol v and the surrounding validation
function so callers receive None instead of "".

@mustangxu mustangxu closed this May 24, 2026
@mustangxu
mustangxu deleted the 15175 branch May 24, 2026 05:29
@mustangxu
mustangxu restored the 15175 branch May 24, 2026 05:30
@mustangxu mustangxu reopened this May 24, 2026
@wangq8 wangq8 added the ci Continue Integration label May 25, 2026
@wangq8
wangq8 marked this pull request as draft May 25, 2026 05:36
@wangq8
wangq8 marked this pull request as ready for review May 25, 2026 05:36
@wangq8

wangq8 commented May 25, 2026

Copy link
Copy Markdown
Collaborator

LGTM

@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (e6dd397) to head (9d022a3).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15177      +/-   ##
==========================================
- Coverage   94.53%   93.12%   -1.41%     
==========================================
  Files          10       10              
  Lines         713      713              
  Branches      116      116              
==========================================
- Hits          674      664      -10     
- Misses         25       29       +4     
- Partials       14       20       +6     

☔ 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.

@wangq8
wangq8 merged commit 54c3d23 into infiniflow:main May 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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