diff --git a/examples/popmon_dp_loader_example.ipynb b/examples/popmon_dp_loader_example.ipynb index 3ddb267da..9d063dbac 100644 --- a/examples/popmon_dp_loader_example.ipynb +++ b/examples/popmon_dp_loader_example.ipynb @@ -65,7 +65,24 @@ "except ImportError:\n", " import dataprofiler as dp\n", "import pandas as pd\n", - "import popmon # noqa" + "import popmon # noqa\n", + "\n", + "from popmon import Settings\n", + "\n", + "\n", + "def make_settings(time_axis):\n", + " \"\"\"Create popmon Settings with our custom config (popmon 1.0+ API).\n", + "\n", + " A fresh Settings is needed for each pm_stability_report call because\n", + " settings.bin_specs gets mutated on each call. The time_axis must be set\n", + " on settings; the time_axis kwarg to pm_stability_report is ignored when\n", + " settings is provided.\n", + " \"\"\"\n", + " s = Settings()\n", + " s.time_axis = time_axis\n", + " s.report.extended_report = False\n", + " s.monitoring.monitoring_rules = {\"*_pull\": [10, 7, -7, -10]}\n", + " return s" ] }, { @@ -204,8 +221,7 @@ " time_axis=time_index,\n", " time_width=\"1w\",\n", " time_offset=\"2015-07-02\",\n", - " extended_report=False,\n", - " pull_rules={\"*_pull\": [10, 7, -7, -10]},\n", + " settings=make_settings(time_index),\n", ")\n", "\n", "# Save popmon reports\n", @@ -234,8 +250,7 @@ " time_axis=time_index,\n", " time_width=\"1w\",\n", " time_offset=\"2015-07-02\",\n", - " extended_report=False,\n", - " pull_rules={\"*_pull\": [10, 7, -7, -10]},\n", + " settings=make_settings(time_index),\n", ")\n", "\n", "# Save popmon reports\n", @@ -366,8 +381,7 @@ " time_axis=time_index,\n", " time_width=\"1w\",\n", " time_offset=\"2015-07-02\",\n", - " extended_report=False,\n", - " pull_rules={\"*_pull\": [10, 7, -7, -10]},\n", + " settings=make_settings(time_index),\n", ")" ] },