From 4e263a9c06ddfdafec13779eb82914e5621a3420 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9=20=20JOST-MOUSSEAU?=
 <timothe.jost-mousseau@pasteur.fr>
Date: Tue, 19 Mar 2024 00:58:15 +0100
Subject: [PATCH] Update pipelines.py

---
 src/pypelines/pipelines.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/pypelines/pipelines.py b/src/pypelines/pipelines.py
index 25f879d..8428148 100644
--- a/src/pypelines/pipelines.py
+++ b/src/pypelines/pipelines.py
@@ -140,7 +140,15 @@ class Pipeline:
         return PipelineGraph(self)
 
     def configure_celery(self) -> None:
-        from .tasks import CeleryHandler
+        try : 
+            from .tasks import CeleryHandler
+        except ImportError:
+            getLogger().warning(
+                f"Celery is not installed. Cannot set it up for the pipeline {self.pipeline_name}"
+                "Don't worry, about this alert, "
+                "this is not be an issue if you didn't explicitely planned on using celery."
+            )
+            return
 
         celery = CeleryHandler(self.conf_path, self.pipeline_name)
         if celery.success:
-- 
GitLab