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

dvc.yaml: make persist/cache bool flags in outs/metrics #3804

Closed
wants to merge 1 commit into from

Conversation

efiop
Copy link
Contributor

@efiop efiop commented May 14, 2020

More explicit CLI-like options metrics/persist_no_cache are still supported,
but we use flags when generating dvc.yaml.

Part of #3409, prerequisite for plot.

  • ❗ 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. If the CLI API is changed, I have updated tab completion scripts.

  • ❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)

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

@efiop efiop changed the title dvc.yaml: make persist/cache bool flags in outs/metrics [WIP] dvc.yaml: make persist/cache bool flags in outs/metrics May 14, 2020
@efiop efiop self-assigned this May 14, 2020
METRICS = "metrics"
NO_CACHE = "outs_no_cache"
OUTS = "outs"
PARAM_OUTS_PERSIST = "outs_persist"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, might be worth renaming it to persist instead of outs_persist. Looks a lot nicer that way.

Copy link
Member

Choose a reason for hiding this comment

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

may be in this case we can make it a flag within the outs item?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shcheklein It is that already :) But we also keep plain format where it mimics CLI options. So I wonder if we should make it persist and --persist in dvc run.

Copy link
Member

Choose a reason for hiding this comment

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

yep, sounds good to me! never liked these JAVA-style - --outs-enterprisy-long-name-include-everything :)

},
)
],
Optional(StageParams.PARAM_OUTS_NO_CACHE): [str],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Being a bit restrictive here and not allowing additional flags (e.g. persist=True) for such fields.

],
Optional(StageParams.PARAM_OUTS_NO_CACHE): [str],
Optional(StageParams.PARAM_METRICS): [
Any(str, {str: {Optional(BaseOutput.PARAM_CACHE): bool}})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not supporting persist for metrics because it is the way we currently generate it during the serialization. Plus we don't really have a CLI option for it. But seems like persistent metrics does make sense, especially when we talk about plots that might accumulate data from run to run. But let's wait for someone to ask for it.

Note that in old dvc-files that(persistent metrics) was supported if user set metric: True, persist=True by hand.

bucket_key += ["persist"]
extra = {}
if o.persist:
extra["persist"] = True
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just matching existing style in this method, so using plain strings. Maybe we should discuss strings vs constants one more time, to see how people feel about it these days.

More explicit CLI-like options `metrics/persist_no_cache` are still supported,
but we use flags when generating dvc.yaml.

Part of iterative#3409, prerequisite for `plot`.
@efiop efiop changed the title [WIP] dvc.yaml: make persist/cache bool flags in outs/metrics dvc.yaml: make persist/cache bool flags in outs/metrics May 14, 2020
@efiop efiop requested a review from skshetry May 14, 2020 23:35
@efiop
Copy link
Contributor Author

efiop commented May 15, 2020

Aaand I wondered why there is no cache: True even though I thought that we've merged it :D Closing in favor of #3785

@efiop efiop closed this May 15, 2020
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