-
Notifications
You must be signed in to change notification settings - Fork 37
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
dvcyaml: write to cwd instead of git root #729
Conversation
@@ -63,7 +63,7 @@ def __init__( | |||
resume: bool = False, | |||
report: Optional[str] = None, | |||
save_dvc_exp: bool = True, | |||
dvcyaml: Union[str, bool] = True, | |||
dvcyaml: Union[str, bool] = "dvc.yaml", |
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.
Now that there is a constant value, it seems more transparent to make the default value a string. Keeping a boolean option for now to not break existing behavior.
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
does it meant that depending on where I run the command (e.g. yolo train ...) I might end up with a few |
Yes, it's possible if you run it from different places. I can think of cases where each behavior is "better." For example, if I have multiple pipelines, always writing to the root could be worse.
It is based on the current path, not the root (same as this PR). |
if self._dvc_repo is not None: | ||
return os.path.join(self._dvc_repo.root_dir, "dvc.yaml") | ||
logger.warning( | ||
"Can't infer dvcyaml path without a DVC repo. " | ||
"`dvc.yaml` file will not be written." | ||
) | ||
return "" |
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.
dvcyaml: write to cwd instead of git root
Looking at the diff, it seems it was dvc's root, not git root, right?
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.
Yes, you are right
|
Yes, sorry, the description is a bit sloppy. This does not guarantee it uses your cwd. As discussed above with @shcheklein, this PR matches the behavior for creating the dvclive directory, so it seems most consistent with existing dvclive behavior (the dvc.yaml and dvclive directory should be in the same place). |
My solution and online course are built on top of DVC and DVC Live. I really appreciate your work and understand that you have to continue developing the tool, but breaking changes like this result in a lot of overhead on my end. Maybe there is a way to reduce those in the future. Thanks a lot! |
Sorry for the incovenience @BastiQ. Obviously, this isn't best practice and we do our best to avoid breaking changes in minor releases. If this or other changes are causing specific issues for you, feel free to follow up with more details. |
Instead of defaulting to the git root for dvc.yaml, use the current path. This is technically a breaking change, but it simplifies the dvc.yaml logic and should have the same behavior for most users.
Rationale for this change:
dvc stage add
writesdvc.yaml
in the current directory, not the git root)