From 487fe75946c6ee71820524bf4e4bb0ffb58b3890 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 28 Feb 2023 17:13:14 +0200 Subject: [PATCH] Fix dataset CSV files are not previewed properly --- clearml/datasets/dataset.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/clearml/datasets/dataset.py b/clearml/datasets/dataset.py index 3dad4626..d8b2eedc 100644 --- a/clearml/datasets/dataset.py +++ b/clearml/datasets/dataset.py @@ -2917,12 +2917,15 @@ class Dataset(object): if artifact is not None: # noinspection PyBroadException try: - # we do not use report_table if default_upload_destination is set because it will - # not upload the sample to that destination, use report_media instead - if isinstance(artifact, pd.DataFrame) and not self._task.get_logger().get_default_upload_destination(): - self._task.get_logger().report_table( - "Tables", "summary", table_plot=artifact - ) + # we only use report_table if default_upload_destination is not set + # (it is the same as the file server) + # because it will not upload the sample to that destination. + # use report_media instead to not leak data + if ( + isinstance(artifact, pd.DataFrame) + and self._task.get_logger().get_default_upload_destination() == Session.get_files_server_host() + ): + self._task.get_logger().report_table("Tables", "summary", table_plot=artifact) else: self._task.get_logger().report_media( "Tables", file_name, stream=artifact.to_csv(index=False), file_extension=".txt"