Skip to content

Commit e9280f8

Browse files
committed
switch anchor_revs to revs_with_datapoints
1 parent 73110a0 commit e9280f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dvc/render/match.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ def match_defs_renderers( # noqa: C901, PLR0912
101101
else:
102102
renderer_cls = VegaRenderer
103103
renderer_id = plot_id
104-
if rev not in revs:
105-
revs.append(rev)
106104

107105
converter = _get_converter(renderer_cls, inner_id, props, definitions_data)
108106

@@ -112,6 +110,8 @@ def match_defs_renderers( # noqa: C901, PLR0912
112110

113111
try:
114112
dps, rev_props = converter.flat_datapoints(rev)
113+
if dps and rev not in revs:
114+
revs.append(rev)
115115
except Exception as e: # noqa: BLE001
116116
logger.warning("In %r, %s", rev, str(e).lower())
117117
def_errors[rev] = e
@@ -125,7 +125,7 @@ def match_defs_renderers( # noqa: C901, PLR0912
125125
first_props["title"] = renderer_id
126126

127127
if revs:
128-
first_props["anchor_revs"] = revs
128+
first_props["revs_with_datapoints"] = revs
129129

130130
if renderer_cls is not None:
131131
renderer = renderer_cls(plot_datapoints, renderer_id, **first_props)

tests/unit/render/test_match.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_match_renderers(M):
173173
]
174174
assert renderer.properties == {
175175
"anchors_y_definitions": [{"filename": "file.json", "field": "y"}],
176-
"anchor_revs": ["v1", "revision_with_no_data"],
176+
"revs_with_datapoints": ["v1"],
177177
"title": "plot_id_1",
178178
"x": "x",
179179
"y": "y",

0 commit comments

Comments
 (0)