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

meta: add version_id #153

Merged
merged 1 commit into from
Aug 30, 2022
Merged

meta: add version_id #153

merged 1 commit into from
Aug 30, 2022

Conversation

pmrowla
Copy link
Contributor

@pmrowla pmrowla commented Aug 29, 2022

No description provided.

@pmrowla pmrowla self-assigned this Aug 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2022

Codecov Report

Merging #153 (8549898) into main (5654d2b) will decrease coverage by 0.11%.
The diff coverage is 42.85%.

@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
- Coverage   55.43%   55.31%   -0.12%     
==========================================
  Files          41       41              
  Lines        2345     2350       +5     
  Branches      423      424       +1     
==========================================
  Hits         1300     1300              
- Misses        965      976      +11     
+ Partials       80       74       -6     
Impacted Files Coverage Δ
src/dvc_data/fs.py 60.00% <ø> (ø)
src/dvc_data/hashfile/state.py 34.45% <0.00%> (-0.90%) ⬇️
src/dvc_data/hashfile/hash.py 75.00% <100.00%> (ø)
src/dvc_data/hashfile/meta.py 80.00% <100.00%> (+2.22%) ⬆️
src/dvc_data/build.py 60.31% <0.00%> (-1.59%) ⬇️
src/dvc_data/cli.py 32.01% <0.00%> (ø)
src/dvc_data/db/index.py 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines 101 to 104
if fs.version_aware:
_, version_id = fs.path.split_version(path)
else:
version_id = None
Copy link
Member

Choose a reason for hiding this comment

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

State does not support non-local filesystems, so I don't think we need to add support for this. It's a dead code. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that this is needed for some of the things @efiop is working on

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, let's keep this (using this in POCs, but could probably turn this on later too).

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer not adding this dead code. In POC, you can cherry-pick easily, no need to add to main.
We don't even support non-local filesystems, version-aware fs is too far.

Copy link
Member

Choose a reason for hiding this comment

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

The design of the State might even change, or there may be no state in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

@skshetry It is very close actually 🙂

Copy link
Contributor

@efiop efiop Aug 30, 2022

Choose a reason for hiding this comment

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

Though version_ids are problematic for state in https://github.com/iterative/dvc-data/pull/153/files#r958293617 so we might indeed want to not touch it in this PR.

Comment on lines 101 to 102
if fs.version_aware:
_, version_id = fs.path.split_version(path)
Copy link
Contributor

@efiop efiop Aug 30, 2022

Choose a reason for hiding this comment

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

The version id should probably be extracted from info call (same as size and etag in the future). But I guess this is a bit debatable and when version_id is specified in the path - maybe we need to treat it as a path...

Copy link
Contributor

Choose a reason for hiding this comment

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

Also version_aware is only present for some filesystems, you'll get an attribute error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we might want to treat path with version_id as a complete path here, because you might have a situation where you have s3://bucket/path and s3://bucket/path?version_id=12434 at the same time and state should actually care about both. Hm...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also version_aware is only present for some filesystems, you'll get an attribute error.

This is addressed in the open dvc-objects PR https://github.com/iterative/dvc-objects/pull/133/files#

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and yes we would need to use the versioned path with state, or modify lookups to work like

def get(self, path, fs, version_id=None):

(or potentially meta=None)

@pmrowla
Copy link
Contributor Author

pmrowla commented Aug 30, 2022

It sounds like we should just drop the state changes and follow up on that later, and then merge this + the dvc-objects PR for now

@pmrowla pmrowla marked this pull request as ready for review August 30, 2022 13:19
@pmrowla
Copy link
Contributor Author

pmrowla commented Aug 30, 2022

This depends on the dvc-objects PR and can be merged after that is released iterative/dvc-objects#133

@efiop efiop changed the title [WIP] meta: add version_id meta: add version_id Aug 30, 2022
Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

Looks like we don't even need that dvc-objects change for now.

Looks good! Thank you! 🙏

@efiop efiop merged commit 5f6ba22 into iterative:main Aug 30, 2022
@pmrowla pmrowla deleted the meta-version-id branch August 30, 2022 17:44
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.

4 participants