From 45af97b258d9693c787467b050abb5b04f3ec8da Mon Sep 17 00:00:00 2001 From: cksac Date: Thu, 12 Nov 2020 19:06:45 +0800 Subject: [PATCH] Fix set preview for if artifact body is remote uri (#239) Co-authored-by: cksac --- trains/binding/artifacts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trains/binding/artifacts.py b/trains/binding/artifacts.py index f50e4e26..edabe46c 100644 --- a/trains/binding/artifacts.py +++ b/trains/binding/artifacts.py @@ -462,6 +462,8 @@ class Artifacts(object): uri = artifact_object artifact_type = 'custom' artifact_type_data.content_type = mimetypes.guess_type(artifact_object)[0] + if preview: + artifact_type_data.preview = preview elif isinstance(artifact_object, six.string_types): # if we got here, we should store it as text file. artifact_type = 'string'