-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Raise informative missing s3 extra #7501
Conversation
@nsorros I am sorry for the late response. Could you verify that the problem still exists on current
When running with dvc installed from this branch I get:
So both seem ok, though the problem is still |
I am getting the same error using the latest main which I install using
If you have trouble reproducing this as described in the issue, maybe I could provide a more complete script? |
@nsorros I would be thankful. Mine looks like this:
And the error:
|
This is a script to reproduce the problem
this gives me
|
@nsorros thanks, right, I didn't make a dir, but a file, that's the problem. I can reproduce. Reviewing... |
Indeed, I just tested with a file and the error is the correct one, so this seems to affect directories only. |
Ok, so indeed, I can confirm this fix improves error message raised upon download of dir, when dependencies for remote is missing. It would be great to add a test for that. However, this alone will not fix all aspects of #6870, as another problem is that we are displaying "Everythin is up to date". @nsorros would you be willing to write a test? I think we could close #6870 with this PR, and create a new issue, regarding the "Everything is up to date", as its not related to original problem of #6870, which was unclear messaging for lacking deps. |
Happy to add a test, I assume this would go in |
@nsorros So what we need to do would be to make a test that would verify, that upon trying to fetch a dir,
|
I made a start on the test but I am slightly confused as to why it passes at this point instead of raising an exception. I am including the test below
I will keep investigating, let me know if you have any thoughts @pared |
0bc66e0
to
844713c
Compare
Resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsorros
Something is off, the codecov says the fix has not been tested and the test passes regardless if fix is in place or not, seems like my suggestion how to mock it was not that good, I'll take a look.
for more information, see https://pre-commit.ci
Co-authored-by: Paweł Redzyński <[email protected]>
4b8f1b1
to
69138aa
Compare
Patching |
Yeah, it's called whenever fs is created, so basically any operation on filesystem :) My bad. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move the test to
tests/unit/output/test_output.py
.
tests/func/test_data_cloud.py
Outdated
with patch( | ||
"dvc.data_cloud.DataCloud.get_remote_odb", | ||
side_effect=RemoteMissingDepsError("remote missing"), | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To maintain consistency between tests I would suggest using mocker
fixture.
then just mocker.patch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 8a37f70 |
Anything else I need to do on this PR @pared? What's the process for merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsorros sorry, did not have time on friday to check that one.
Co-authored-by: Paweł Redzyński <[email protected]>
I am assuming someone from DVC will merge this as merging seems to be restricted to authorised users. Let me know if you need me to do anything else on this. |
@nsorros yeah, I will wait till tomorrow if one more person finds time to check it, if not I will merge it. |
As described in #6870 when s3 extra missing dvc does not always raise the informative message that it should be installed. This has to do with catching a generic DvcException and adding a debug message which I am overwriting here in that case to allow the Exception to propagate.
I am not sure this is the right place to catch the exception and additionally this might affect other cases as well which I am happy to address like non directory based hashes. Assuming this is the right place to catch the exception, happy to work on adding a test for this.
Fixes #6870 ?
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏