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

plots: standardise across DVC/Studio/VS Code #9931

Merged
merged 14 commits into from
Dec 6, 2023

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Sep 11, 2023

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™


Related to #9940

This PR contains changes to accept the version of dvc-render created by iterative/dvc-render#142. See that PR for a detailed description of the overall change.

Docs:

Downstream:

@@ -274,11 +274,9 @@ def flat_datapoints(self, revision): # noqa: C901, PLR0912
_update_all(
datapoints,
update_dict={
VERSION_FIELD: {
Copy link
Member Author

@mattseddon mattseddon Sep 11, 2023

Choose a reason for hiding this comment

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

[F] The reason for having this inside of a nested dict was because we wanted to get rid of the data before it showed up in a tooltip. However, none of the tooltips from the updated templates will show any of this data. It is therefore safe to remove.

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (1aed230) 90.35% compared to head (984860b) 90.35%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9931   +/-   ##
=======================================
  Coverage   90.35%   90.35%           
=======================================
  Files         496      496           
  Lines       37754    37737   -17     
  Branches     5490     5485    -5     
=======================================
- Hits        34113    34099   -14     
+ Misses       2980     2978    -2     
+ Partials      661      660    -1     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@mattseddon mattseddon changed the title plots: Standardise/consolidate plots data across products plots: standardise/consolidate plots data across products Sep 11, 2023
@dberenbaum
Copy link
Collaborator

dberenbaum commented Sep 11, 2023

What I can recall from #9019 and iterative/dvc-render#119 is:

  1. We need to keep the rev field as is (it is actually not just the revision but actually like rev::file::field) to not break for custom templates that depend on it.
  2. Having a combined field like rev::file::field as a unique ID for a line/series is useful for things like yOffset in vega-lite.
  3. Not directly related/needed, but Use dvc_... fields from https://github.com/iterative/dvc/pull/9019Β dvc-render#119 also includes consolidation of the strokeDash and shape so they don't need to be configured in downstream products.

@mattseddon
Copy link
Member Author

What I can recall from #9019 and iterative/dvc-render#119 is:

  1. We need to keep the rev field as is (it is actually not just the revision but actually like rev::file::field) to not break for custom templates that depend on it.
  2. Having a combined field like rev::file::field as a unique ID for a line/series is useful for things like yOffset in vega-lite.
  3. Not directly related/needed, but Use dvc_... fields from https://github.com/iterative/dvc/pull/9019Β dvc-render#119 also includes consolidation of the strokeDash and shape so they don't need to be configured in downstream products.

Thanks @dberenbaum. All good information.

For 1. IIUC this only happened for the HTML output and not in Studio/VS Code. Is that correct?

@dberenbaum
Copy link
Collaborator

For 1. IIUC this only happened for the HTML output and not in Studio/VS Code. Is that correct?

Not sure I follow. If I use a custom template and that template includes the field rev, wouldn't it break even in VS Code and Studio if we change what's in that field or drop that field? You know better than me how we handle custom templates in VS Code and Studio.

@mattseddon mattseddon force-pushed the standardise-plot-data branch 2 times, most recently from 19a9c51 to e24b0ec Compare September 19, 2023 04:30
@mattseddon mattseddon self-assigned this Sep 19, 2023
dvc/render/convert.py Outdated Show resolved Hide resolved
dvc/render/convert.py Outdated Show resolved Hide resolved
@mattseddon mattseddon force-pushed the standardise-plot-data branch from e24b0ec to 1eab66d Compare September 22, 2023 01:51
@mattseddon mattseddon force-pushed the standardise-plot-data branch 2 times, most recently from 60111ac to c63b19a Compare October 3, 2023 02:24
@mattseddon mattseddon force-pushed the standardise-plot-data branch 4 times, most recently from e89bf32 to 9ca524d Compare October 10, 2023 00:21
@mattseddon mattseddon force-pushed the standardise-plot-data branch from 9ca524d to c2eebeb Compare October 15, 2023 02:12
@mattseddon mattseddon force-pushed the standardise-plot-data branch from c2eebeb to 4d94338 Compare November 1, 2023 23:18
@mattseddon mattseddon changed the title plots: standardise/consolidate plots data across products plots: standardise across DVC/Studio/VS Code Nov 7, 2023
@mattseddon mattseddon force-pushed the standardise-plot-data branch 2 times, most recently from 42a542b to 1d367d0 Compare November 14, 2023 02:55
@dberenbaum
Copy link
Collaborator

@mattseddon Where did we land on breaking changes for custom templates? Are there known use cases that will or won't work with old custom templates?

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

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

@mattseddon This one looks nice! Good to see that all that added code in dvc-render at least made dvc a bit cleaner πŸ˜„ (and I assume made VS Code and Studio much cleaner). Once dvc-render is released and we update the pinned version here, I'll approve.

@mattseddon
Copy link
Member Author

mattseddon commented Dec 4, 2023

@mattseddon Where did we land on breaking changes for custom templates? Are there known use cases that will or won't work with old custom templates?

I feel like we've verbally agreed on this a few times but there is at least one reference in #9940 here: #9940 (comment)
and we have this in the assumptions section of the description:

Usage of custom templates is low enough not to worry about being backwards compatible with user-defined custom templates.

With that said custom templates should not completely break, but they may not render as expected because we will no longer be injecting values into them with VS Code or Studio.

@mattseddon mattseddon force-pushed the standardise-plot-data branch from 17155a1 to 69cc821 Compare December 4, 2023 04:57
@dberenbaum
Copy link
Collaborator

I feel like we've verbally agreed on this a few times but there is at least one reference in #9940 here: #9940 (comment) and we have this in the assumptions section of the description:

Usage of custom templates is low enough not to worry about being backwards compatible with user-defined custom templates.

We have definitely agreed before. I just couldn't remember exactly what we agreed, so thanks for the refresher. Do you think there's anything helpful to document about migrating old custom templates?

pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

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

@mattseddon I'm approving to unblock you, but please make sure not to forget the version bump.

@mattseddon mattseddon force-pushed the standardise-plot-data branch from e140da0 to c3dbd03 Compare December 5, 2023 05:35
@mattseddon mattseddon force-pushed the standardise-plot-data branch from c3dbd03 to 984860b Compare December 5, 2023 22:44
@mattseddon mattseddon merged commit 5bb72b3 into iterative:main Dec 6, 2023
21 checks passed
@mattseddon mattseddon deleted the standardise-plot-data branch December 6, 2023 00:25
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