Skip to content

Commit

Permalink
Fix chart artifact to have db key (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedingber committed Sep 22, 2020
1 parent 15bfc20 commit 61b0c2c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
11 changes: 0 additions & 11 deletions mlrun/artifacts/plots.py
Expand Up @@ -86,17 +86,6 @@ def get_body(self):

class ChartArtifact(Artifact):
kind = "chart"
_dict_fields = [
"key",
"kind",
"iter",
"tree",
"src_path",
"target_path",
"hash",
"description",
"viewer",
]

def __init__(
self,
Expand Down
Empty file added tests/artifacts/__init__.py
Empty file.
22 changes: 22 additions & 0 deletions tests/artifacts/test_artifacts.py
@@ -0,0 +1,22 @@
import mlrun.artifacts


def test_artifacts_export_required_fields():
artifact_classes = [
mlrun.artifacts.Artifact,
mlrun.artifacts.ChartArtifact,
mlrun.artifacts.PlotArtifact,
mlrun.artifacts.DatasetArtifact,
mlrun.artifacts.ModelArtifact,
mlrun.artifacts.TableArtifact,
]

required_fields = [
"key",
"kind",
"db_key",
]

for artifact_class in artifact_classes:
for required_field in required_fields:
assert required_field in artifact_class._dict_fields

0 comments on commit 61b0c2c

Please sign in to comment.