(#2509) end-to-end JSON field handling fix for CLI launched training job #2511
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.
Closes #2509
This pull request improves the handling of fields with the
TEXT_JSONtype (such asmodelspec_comment) throughout the configuration pipeline, ensuring that JSON arrays are correctly serialized and deserialized when passing through CLI arguments. It also adds comprehensive tests to verify that these fields behave as expected, both for arrays and strings.Enhancements to TEXT_JSON field handling:
mapping_to_cli_argsincli_utils.pyto detect fields registered asTEXT_JSONin the field registry and JSON-serialize their values when necessary, ensuring consistent CLI argument formatting for fields likemodelspec_comment. [1] [2]_process_modelspec_commentincmd_args.pyto recognize and parse JSON string representations of arrays, converting them into newline-joined strings for downstream use.Testing improvements:
TestTextJsonConfigLoadingclass intest_text_json_field.pyto verify thatTEXT_JSONfields (e.g.,modelspec_comment) are correctly serialized to JSON in CLI args, passed through as strings when appropriate, and properly processed through the full configuration pipeline.