Do not allow dataset metadata entries that start with data_

This commit is contained in:
Alex Burlacu 2023-03-23 13:11:07 +02:00
parent 11aee6c8e9
commit 2e6e0c1a1d

View File

@ -807,6 +807,8 @@ class Dataset(object):
Attach a user-defined metadata to the dataset. Check `Task.upload_artifact` for supported types. Attach a user-defined metadata to the dataset. Check `Task.upload_artifact` for supported types.
If type is Optionally make it visible as a table in the UI. If type is Optionally make it visible as a table in the UI.
""" """
if metadata_name.startswith(self.__data_entry_name_prefix):
raise ValueError("metadata_name can not start with '{}'".format(self.__data_entry_name_prefix))
self._task.upload_artifact(name=metadata_name, artifact_object=metadata) self._task.upload_artifact(name=metadata_name, artifact_object=metadata)
if ui_visible: if ui_visible:
if pd and isinstance(metadata, pd.DataFrame): if pd and isinstance(metadata, pd.DataFrame):