refactor: declarative schema for configuration#963
Open
cmgzn wants to merge 5 commits intodatajuicer:mainfrom
Open
refactor: declarative schema for configuration#963cmgzn wants to merge 5 commits intodatajuicer:mainfrom
cmgzn wants to merge 5 commits intodatajuicer:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a declarative configuration schema using Pydantic, centralizing configuration definitions and refactoring the argument parser and default settings logic. It also updates dataset building and event logging to support the new configuration structure. Feedback highlights a redundant conditional block in the schema registration function and an unused helper function in the recipe flow tool that should be removed.
…parameters with and without defaults
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.
Core Changes
data_juicer/config/schema.py(938 lines): DefineDJConfigPydantic model as single source of truth for global configdata_juicer/config/config.py: Migrate 673 lines of field definitions to schema module; retain only parser construction logicConfigValidator: Support mergingBASE_CONFIG_RULESwithCONFIG_VALIDATION_RULESTechnical Benefits
parser.add_argument()callsget_json_schema(),get_defaults()) for external tool integrationImpact Scope
data_juicer/core/data/dataset_builder.py: Adapt to new config structuredata_juicer/core/data/load_strategy.py: Adapt to merged validation rulesdata_juicer/tools/DJ_mcp_recipe_flow.py: Adapt to config API changes