From 111d6b01173106b2d5d9013ede31bdcf5aca7fc5 Mon Sep 17 00:00:00 2001 From: bvolodarskiy Date: Fri, 16 Jun 2023 12:39:26 +0300 Subject: [PATCH] disable wordcloud when no words --- functions/data_test/profiling.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/data_test/profiling.py b/functions/data_test/profiling.py index 59f9a13..95441c9 100755 --- a/functions/data_test/profiling.py +++ b/functions/data_test/profiling.py @@ -233,11 +233,15 @@ def profile_data(df, suite_name, cloudfront, datasource_root, source_covered, try: profile = ProfileReport(df, title=f"{suite_name} Profiling Report", minimal=True, pool_size=1) - report = profile.to_html() except TypeError: profile = ProfileReport(df, title=f"{suite_name} Profiling Report", pool_size=1) + try: report = profile.to_html() + except ValueError: + profile.config.vars.text.words = False + report = profile.to_html() + if not source_covered: try: pipeline_config = json.loads(wr.s3.read_json(