Conversation
somuai
force-pushed
the
fix-autogen-artifact-name-maxlen
branch
2 times, most recently
from
September 10, 2026 14:42
cda3fff to
708a896
Compare
…wandb#11212) Enforce NAME_MAXLEN (128 characters) in sanitize_artifact_name so that auto-generated internal artifact names (e.g. run tables, incremental tables) do not exceed client-side validator constraints and cause unexpected ValueErrors. Long names are truncated with middle ellipsis while preserving the CRC32 collision-prevention suffix. Also ensure default artifact names generated in log_artifact are passed through make_artifact_name_safe. Signed-off-by: Soumyajit Ghosh <jobsoumyajit6124@gmail.com>
somuai
force-pushed
the
fix-autogen-artifact-name-maxlen
branch
from
October 5, 2026 19:53
708a896 to
9a20cfb
Compare
📋 Code Owner SummaryThis PR modifies 5 files. Each section below is a group of files and their owners from Legend: ✅ approval acquired, 🟠 approval still required, 👀 advisory/informational only. Send a review request to a team's channel by adding a 🟠 @wandb/sdk-team — approval still required🟠 @wandb/art-reg-team, @wandb/sdk-team — approval still required
Automatically updated by wandbot from the |
Author
|
Update:
Ready for review. |
This branch has not been deployed
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.
Description
When client-side artifact name validation was added in #9594,
validate_artifact_name(name)strictly enforceslen(name) <= 128. However, internal auto-generated artifact names (such as run tables created viaInternalArtifact(f"run-{run.id}-{key}", "run_table"), incremental tables created via_get_artifact_name(run, key), or default names generated when logging files vialog_artifact) could exceed 128 characters when table keys or filenames are long. This caused unpredictableValueError: Artifact name is longer than 128 characterserrors on valid user workflows.Changes
sanitize_artifact_name(name: str) -> strinwandb/sdk/artifacts/_internal_artifact.pyto enforceNAME_MAXLEN = 128. Names longer than 128 characters (or with characters sanitized) are safely truncated using middle ellipsis while preserving the 6-character CRC32 suffix to prevent collection name collisions.sanitizedprefix is empty (e.g. input composed purely of stripped characters) by defaulting to"artifact".Run.log_artifact()(wandb/sdk/wandb_run.py) are passed throughwandb.util.make_artifact_name_safewhennameis omitted.tests/unit_tests/test_artifacts/test_internal_artifact.pycovering preservation of valid names, character sanitization, length bounding, idempotency, uniqueness, andInternalArtifactinitialization with long keys.validate_artifact_nameintests/unit_tests/test_artifacts/test_validators.py.CHANGELOG.unreleased.md.Testing
pytest:tests/unit_tests/test_artifacts/test_internal_artifact.py(15 passed)tests/unit_tests/test_artifacts/test_validators.py(89 passed)len=129,len=200,len=500).ruff checkandruff format.