Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(artifacts): raise for invalid artifact names #8773

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tonyyli-wandb
Copy link
Contributor

@tonyyli-wandb tonyyli-wandb commented Nov 5, 2024

Description

Validates Artifact names on instantiation, raising a ValueError if the name is expected to be invalid (i.e. the artifact cannot be logged).

  • I updated CHANGELOG.md, or it's not applicable

Testing

How was this PR tested?

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tonyyli-wandb and the rest of your teammates on Graphite Graphite

@tonyyli-wandb tonyyli-wandb marked this pull request as ready for review November 5, 2024 16:53
@tonyyli-wandb tonyyli-wandb requested a review from a team as a code owner November 5, 2024 16:53
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.34%. Comparing base (e7c06b8) to head (1db7461).
Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8773      +/-   ##
==========================================
- Coverage   70.34%   70.34%   -0.01%     
==========================================
  Files         547      547              
  Lines       58097    58107      +10     
==========================================
+ Hits        40868    40873       +5     
- Misses      16565    16574       +9     
+ Partials      664      660       -4     
Flag Coverage Δ
func 36.95% <64.28%> (+<0.01%) ⬆️
system 54.57% <100.00%> (-0.04%) ⬇️
unit 51.25% <78.57%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
wandb/apis/public/artifacts.py 93.39% <100.00%> (+0.02%) ⬆️
wandb/sdk/artifacts/_validators.py 100.00% <100.00%> (ø)
wandb/sdk/artifacts/artifact.py 88.74% <100.00%> (+0.11%) ⬆️

... and 22 files with indirect coverage changes

Copy link
Contributor

@ibindlish ibindlish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

(non-blocking question): The ArtifactCollection class also has a name setter:

def name(self, name: List[str]) -> None:
self._name = name

I think we can use the same validator to check the artifact name there since the validator for artifact.name is also for sequence name. Wdyt?

@tonyyli-wandb
Copy link
Contributor Author

(non-blocking question): The ArtifactCollection class also has a name setter:

def name(self, name: List[str]) -> None:
self._name = name

I think we can use the same validator to check the artifact name there since the validator for artifact.name is also for sequence name. Wdyt?

Good point -- I think so too. Thanks for the catch!

@tonyyli-wandb tonyyli-wandb requested a review from a team as a code owner November 8, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants