From e07c37e9d23ccbf830052b371b728ca115976854 Mon Sep 17 00:00:00 2001
From: David McKenna <mckenna@astron.nl>
Date: Tue, 27 May 2025 19:52:50 +0200
Subject: [PATCH] FIX: Only update tqdm desc if we are using tqdm

---
 l2json/sources/minio.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/l2json/sources/minio.py b/l2json/sources/minio.py
index eb95215..424b56d 100644
--- a/l2json/sources/minio.py
+++ b/l2json/sources/minio.py
@@ -90,9 +90,10 @@ def fetch_minio_entries(
                     reference=objname if store_filename else "",
                 )
                 parsed_files += 1
-                objects.set_description(
-                    f"{tqdm_desc} ({parsed_files} file(s) kept, {(1 - (tend + dt - t).total_seconds() / (tend - tstart + 2 * dt).total_seconds()) * 100:.1f}% through the observing window)"
-                )
+                if tqdm_desc:
+                    objects.set_description(
+                        f"{tqdm_desc} ({parsed_files} file(s) kept, {(1 - (tend + dt - t).total_seconds() / (tend - tstart + 2 * dt).total_seconds()) * 100:.1f}% through the observing window)"
+                    )
         working_day += timedelta(days=1)
     return data
 
-- 
GitLab