diff --git a/mlrun/artifacts/plots.py b/mlrun/artifacts/plots.py index 50c56ad2f6c..c7230ec2110 100644 --- a/mlrun/artifacts/plots.py +++ b/mlrun/artifacts/plots.py @@ -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, diff --git a/tests/artifacts/__init__.py b/tests/artifacts/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/artifacts/test_artifacts.py b/tests/artifacts/test_artifacts.py new file mode 100644 index 00000000000..0fa48592553 --- /dev/null +++ b/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