feat: raise tag string limit to 512 chars and cap tag count at 30 - #1727
Merged
Conversation
Raise tag string max length to 512 chars and lower tags count limit to 30 in experiment settings, with matching test updates.
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.
Summary
调整实验标签(tags)的约束规则:单条 tag 字符串上限从 20 字符放宽到 512 字符,同时将标签数量上限从 50 条收紧到 30 条。
Changes
swanlab/sdk/internal/pkg/constraints/__init__.py—TagStringmax_length 从 20 改为 512swanlab/sdk/internal/settings/experiment.py—Tags列表 max_length 从 50 改为 30tests/unit/sdk/internal/pkg/constraints/test_pkg_constraints.py—TestTagString边界值同步更新tests/unit/sdk/internal/settings/test_settings_experiment.py— 新增test_experiment_tags_count_limit,覆盖 30 条通过 / 31 条报错的场景Testing
Notes
TagString20 → 512 是向后兼容的放宽,不会影响现有存储数据。Tags50 → 30 是收紧约束,已有超过 30 条 tag 的实验在再次写入时可能触发 ValidationError。当前线上 tag 数极少超过此阈值。