Skip to content

Commit

Permalink
Remove VegaConverter TODO and update misleading comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Oct 16, 2023
1 parent ef226a9 commit 9610c49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
17 changes: 4 additions & 13 deletions dvc/render/converter/vega.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ def __init__(
self.plot_id = plot_id
self.inferred_properties: Dict = {}

# TODO we should be handling that in `convert`,
# to avoid stateful `self.inferred_properties`
self._infer_x_y()

def _infer_y_from_data(self):
if self.plot_id in self.data:
for lst in _lists(self.data[self.plot_id]):
Expand Down Expand Up @@ -296,16 +292,11 @@ def convert(
):
"""
Convert the data. Fill necessary fields ('x', 'y') and return both
generated datapoints and updated properties. If `x` is not provided,
leave it as None, fronteds should handle it.
NOTE: Studio uses this method.
The only thing studio FE handles is filling `x` and `y`.
`x/y_label` should be filled here.
Datapoints are not stripped according to config, because users
might be utilizing other fields in their custom plots.
generated datapoints and updated properties. `x`, `y` values and labels
are inferred and always provided.
"""
self._infer_x_y()

datapoints = self._find_datapoints()
properties = {**self.properties, **self.inferred_properties}

Expand Down
1 change: 1 addition & 0 deletions tests/unit/render/test_vega_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def test_finding_lists(dictionary, expected_result):
assert list(result) == expected_result


@pytest.mark.studio
@pytest.mark.parametrize(
"input_data,properties,expected_datapoints,expected_properties",
[
Expand Down

0 comments on commit 9610c49

Please sign in to comment.