Fix support for upload LazyEvalWrapper artifacts

This commit is contained in:
allegroai 2021-10-10 09:03:18 +03:00
parent f25dcde2c1
commit efd786a061

View File

@ -24,6 +24,7 @@ from ..backend_interface.metrics.events import UploadEvent
from ..debugging.log import LoggerRoot
from ..storage.helper import remote_driver_schemes
from ..storage.util import sha256sum, format_size, get_common_path
from ..utilities.proxy_object import LazyEvalWrapper
try:
import pandas as pd
@ -321,6 +322,11 @@ class Artifacts(object):
if preview:
preview = str(preview)
# evaluate lazy proxy object
if isinstance(artifact_object, LazyEvalWrapper):
# noinspection PyProtectedMember
artifact_object = LazyEvalWrapper._load_object(artifact_object)
pathlib_types = (Path, pathlib_Path,) if pathlib_Path is not None else (Path,)
# try to convert string Path object (it might reference a file/folder)