diff --git a/mp3/Validation.ipynb b/mp3/Validation.ipynb index 7efaa6cf412a8a3426b410175fec66829e8acc01..19cab78ec62597740cc3db2a4e1dc1e9dfcc16d9 100644 --- a/mp3/Validation.ipynb +++ b/mp3/Validation.ipynb @@ -48,6 +48,26 @@ " spark = get_or_create(flavor=Flavor.YARN_LARGE)" ] }, + { + "cell_type": "markdown", + "id": "23a80db1", + "metadata": {}, + "source": [ + "Set the desired log level for the analysis output" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "84e52aac", + "metadata": {}, + "outputs": [], + "source": [ + "logging.basicConfig(\n", + " level=logging.WARNING\n", + ") # Options are DEBUG, INFO, WARNING, ERROR, CRITICAL" + ] + }, { "cell_type": "markdown", "id": "55c305e3", @@ -267,10 +287,22 @@ " analysis.query()\n", " analysis.analyze()\n", " except AnalysisError as e:\n", - " return (e, False, \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]))\n", + " return (\n", + " e,\n", + " False,\n", + " \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]),\n", + " )\n", " except Exception as e:\n", - " return (e, None, \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]))\n", - " return (None, analysis.get_analysis_output(), \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]))\n", + " return (\n", + " e,\n", + " None,\n", + " \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]),\n", + " )\n", + " return (\n", + " None,\n", + " analysis.get_analysis_output(),\n", + " \"\\n\".join([logging.Formatter().format(log) for log in analysis.get_logs()]),\n", + " )\n", "\n", "\n", "tests[\"analysisError\"], tests[\"newAnalysisResult\"], tests[\"capturedOutput\"] = zip(\n",