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

chore(sdk): Better docs for run.save() and improved code #7146

Merged
merged 14 commits into from
Mar 13, 2024

Conversation

timoffex
Copy link
Contributor

@timoffex timoffex commented Mar 12, 2024

Description

Fixes: WB-3421
Fixes: #4898

  • Documents run.save() more thoroughly
  • Improves run.save() code and re-enables tests
  • Adds documentation to FilesRecord

I believe the tests were flaky because they were relying on the current working directory of the test runner. This can cause files saved in one test to affect another test.

I removed FilesItem.external_path as it appears unused. I marked its field number as reserved following best practices for updating protos.

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

Testing

Unit tests and the following manual tests:

  • Save a basic relative path like "file.txt"
  • Glob a relative pattern like "dir/*"
  • Glob an absolute pattern like "/Users/.../dir/*"
  • Glob an absolute pattern like "/Users/.../dir/*/file.txt"

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 93.47826% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 74.04%. Comparing base (c6f6719) to head (0a39794).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7146      +/-   ##
==========================================
- Coverage   79.63%   74.04%   -5.60%     
==========================================
  Files         498      498              
  Lines       53594    53601       +7     
==========================================
- Hits        42678    39687    -2991     
- Misses      10588    13580    +2992     
- Partials      328      334       +6     
Flag Coverage Δ
func 43.82% <78.26%> (-5.14%) ⬇️
system 63.96% <76.08%> (-1.63%) ⬇️
unit 54.26% <93.47%> (-3.91%) ⬇️

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

Files Coverage Δ
wandb/sdk/wandb_init.py 88.75% <0.00%> (-2.56%) ⬇️
wandb/sdk/wandb_run.py 89.76% <95.55%> (-0.13%) ⬇️

... and 113 files with indirect coverage changes

@timoffex timoffex marked this pull request as ready for review March 12, 2024 05:49
@timoffex timoffex requested a review from a team as a code owner March 12, 2024 05:49
wandb/sdk/wandb_run.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@kptkin kptkin left a comment

Choose a reason for hiding this comment

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

Thanks for slogging through this function.....

@timoffex timoffex requested a review from kptkin March 12, 2024 23:39
@timoffex
Copy link
Contributor Author

Made some more updates---while fixing some issues, I ended up rewriting _save() to use pathlib to make the code easier to follow.

Copy link
Collaborator

@kptkin kptkin left a comment

Choose a reason for hiding this comment

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

thanks for cleaning this code path!!!

@kptkin
Copy link
Collaborator

kptkin commented Mar 13, 2024

Made some more updates---while fixing some issues, I ended up rewriting _save() to use pathlib to make the code easier to follow.

i think we actually had a request for this, let me try and find it...
found: #4898

@timoffex
Copy link
Contributor Author

Nice! I love it when an issue is fixed by coincidence!

@kptkin
Copy link
Collaborator

kptkin commented Mar 13, 2024

Nice! I love it when an issue is fixed by coincidence!

2 at that, i probably could find more... :)

@timoffex timoffex merged commit 1826e7e into main Mar 13, 2024
65 of 68 checks passed
@timoffex timoffex deleted the timoffex/savefile-2-docs branch March 13, 2024 19:38
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.

[CLI]: wand.save() does not accept pathlib.Path
2 participants