import: clarify -o behavior for subdirectories#1668
Conversation
|
Thanks @pmrowla , really appreciate this! Just curious - is it the same for get? |
|
@shcheklein For get we do a fetch + checkout and create the output subdirectory if it doesn't already exist, since that's the normal behavior for checkout. |
| data will be placed inside. If `path` contains a parent directory which does | ||
| not exist, this command will fail. |
There was a problem hiding this comment.
Sorry for late review @pmrowla, I have a Q:
If
pathcontains a parent directory
What does that mean? "Containing a parent" sounds contradictory. Parents contain you 😋
There was a problem hiding this comment.
Plus how can you contain something that does not exist? Then you don't contain it... Sorry, just confused by this.
There was a problem hiding this comment.
If you run dvc import -o foo/bar and foo/ doesn't already exist, import will fail
There was a problem hiding this comment.
I see, got it. I may reword a little. Thanks Peter!
I'll add this note too. BTW I get the technicality involving internal processes (checkout) but it's kind of weird that get creates them but import doesn't... And why doesn't import use checkout? Hmmmm 🤔 |
|
It's because in import we are defining an actual stage/dependency, but for get it's treated more like a standalone file from treeverse/dvc#4340 (comment)
|
|
Makes sense, that's relevant context for sure. My idea would be that for consistency maybe no DVC commands should makedirs... In fact probably only |
❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.
🐛 Please make sure to mention
Fix #issue(if applicable) in the description of the PR. This causes GitHub to close it automatically when the PR is merged.Please choose to allow us to edit your branch when creating the PR.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏
dvc import -obehavior when output path contains subdirectories.