Skip to content

Stage: fix used_cache warning on no checksum#3365

Merged
efiop merged 1 commit into
treeverse:masterfrom
pared:3359_md5_problem
Feb 21, 2020
Merged

Stage: fix used_cache warning on no checksum#3365
efiop merged 1 commit into
treeverse:masterfrom
pared:3359_md5_problem

Conversation

@pared
Copy link
Copy Markdown
Contributor

@pared pared commented Feb 19, 2020

  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • 📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

Comment thread dvc/output/base.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This property should only return what is already computed, it shouldn't start computing it all over again.

See dvc/outpt/base.py:get_used_cache, where the issue rose. We check if not self.info there, while we should probably check if not self.checksum. Push shouldn't push uncommited changes, as it doesn't even have the cache for them in .dvc/cache.

@pared pared force-pushed the 3359_md5_problem branch 3 times, most recently from 90cebdc to e4b4506 Compare February 20, 2020 11:18
@pared pared changed the title [WIP] 3359 md5 problem Stage: fix used_cache warning on no checksum Feb 20, 2020
@pared pared marked this pull request as ready for review February 20, 2020 11:24
@pared pared requested a review from efiop February 20, 2020 11:24
Comment thread dvc/output/base.py Outdated
Comment thread dvc/output/base.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
out=self, stage=self.stage.relpath
out=self, stage=self.stage

same as above 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AFAIK it will result in dvc commit 'Stage file.dvc' ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pared Oh, but then the upper warning is broken too, right?

Copy link
Copy Markdown
Contributor Author

@pared pared Feb 21, 2020

Choose a reason for hiding this comment

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

@efiop
I wouldn't say so: the upper message is pointing user to which stage particular output is associated to, while the lower one suggests command that can fix your situation. So in the upper one, its not crucial for stage to be printed just as relpath.

Comment thread tests/func/test_stage.py Outdated
Comment on lines 186 to 209
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe let's narrow it down to get_used_cache unit test for output?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

makes sense

@pared pared requested a review from efiop February 20, 2020 18:52
Copy link
Copy Markdown
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.

Thanks!

@efiop efiop merged commit bd33b1a into treeverse:master Feb 21, 2020
@pared pared deleted the 3359_md5_problem branch March 24, 2020 09:36
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