fix: handle None data in skill_processor._parse_skill()#405
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom Mar 4, 2026
Merged
fix: handle None data in skill_processor._parse_skill()#405qin-ctx merged 1 commit intovolcengine:mainfrom
qin-ctx merged 1 commit intovolcengine:mainfrom
Conversation
Add explicit None guard in both process_skill() and _parse_skill() to
raise a clear ValueError("Skill data cannot be None") instead of falling
through to the generic "Unsupported data type: <class 'NoneType'>"
error. This prevents confusing 500 errors on /api/v1/skills when called
with empty/null data.
Also adds unit tests for the None handling.
qin-ctx
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
_parse_skill()raisesValueError: Unsupported data type: <class 'NoneType'>whendataisNone. This causes confusing 500 errors on the/api/v1/skillsendpoint when called with empty/null data.The
Nonevalue falls through allisinstancechecks and hits the genericelsebranch, producing an unhelpful error message.Fix
Add an explicit
Noneguard at the beginning of both:process_skill()(public API, defense in depth)_parse_skill()(where the actual parsing happens)Both raise
ValueError("Skill data cannot be None")with a clear, actionable message.Tests
Added
tests/unit/test_skill_processor_none.pywith 4 tests:test_parse_skill_none_raises_value_error— None raises ValueError with explicit messagetest_parse_skill_none_not_unsupported_type— error message is NOT the generic onetest_parse_skill_valid_dict_passes— valid dict input still workstest_parse_skill_unsupported_type_still_raises— other invalid types still get the generic errorAll tests pass.