From cf31f81105e275f53271cbbada6c08e309258b1e Mon Sep 17 00:00:00 2001 From: marcinpurtak Date: Fri, 24 Nov 2023 12:23:43 +0000 Subject: [PATCH] sharepoint task fail tests --- viadot/flows/sharepoint_to_adls.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/viadot/flows/sharepoint_to_adls.py b/viadot/flows/sharepoint_to_adls.py index 95be2c69f..c2b1a351b 100644 --- a/viadot/flows/sharepoint_to_adls.py +++ b/viadot/flows/sharepoint_to_adls.py @@ -190,14 +190,19 @@ def slugify(name): return name.replace(" ", "_").lower() +class NoDataReturnedError(Exception): + def __init__(self, message): + self.message = message + + @task(slug="check_df") def check_if_df_empty(df): if len(df.index) == 0: logger.info("No data in the response. Df empty") ## raise ENDRUN(state=Failed()) - raise FAIL("DF IS EMPTY!") - # raise ValueError("DF IS EMPTY!") + # raise FAIL("DF IS EMPTY!") + # raise NoDataReturnedError("DF IS EMPTY!") class SharepointListToADLS(Flow):