From ccbb4be7924fbb0408977dde32bd683f4b798abf Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Mon, 19 Jun 2023 17:33:51 +0200 Subject: [PATCH 1/4] fix: drop NaN values when saving the report to the database Signed-off-by: F.N. Claessen --- flexmeasures/cli/data_add.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flexmeasures/cli/data_add.py b/flexmeasures/cli/data_add.py index 847f5fc60..d51374ae7 100755 --- a/flexmeasures/cli/data_add.py +++ b/flexmeasures/cli/data_add.py @@ -1347,10 +1347,10 @@ def add_report( # noqa: C901 "Report computation done, but the report is empty.", **MsgStyle.WARN ) - # save the report it's not running in dry mode + # save the report if it's not running in dry mode if not dry_run: click.echo("Saving report to the database...") - save_to_db(result) + save_to_db(result.dropna()) db.session.commit() click.secho( "Success. The report has been saved to the database.", From f3c783c67da5a20929d4adb76a7ee2ff88f5c63f Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Mon, 19 Jun 2023 17:44:36 +0200 Subject: [PATCH 2/4] docs: changelog entry Signed-off-by: F.N. Claessen --- documentation/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 98260ae8a..4e855c2ad 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -23,6 +23,7 @@ Bugfixes ----------- * Relax constraint validation of `StorageScheduler` to accommodate violations caused by floating point precision [see `PR #731 `_] +* Avoid saving any NaN values to the database, when calling ``flexmeasures add report`` [see `PR #735 `_] v0.14.0 | June 15, 2023 From ba06574fcefe0dd7dec7967f6e6e142a9eac3119 Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Mon, 19 Jun 2023 17:45:21 +0200 Subject: [PATCH 3/4] docs: explain abbreviation Signed-off-by: F.N. Claessen --- documentation/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/changelog.rst b/documentation/changelog.rst index 4e855c2ad..9c5dca1c0 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -23,7 +23,7 @@ Bugfixes ----------- * Relax constraint validation of `StorageScheduler` to accommodate violations caused by floating point precision [see `PR #731 `_] -* Avoid saving any NaN values to the database, when calling ``flexmeasures add report`` [see `PR #735 `_] +* Avoid saving any :abbr:`NaN (not a number)` values to the database, when calling ``flexmeasures add report`` [see `PR #735 `_] v0.14.0 | June 15, 2023 From 9c49d60c5b6d1c07290613b729ce34b236c51644 Mon Sep 17 00:00:00 2001 From: "F.N. Claessen" Date: Mon, 19 Jun 2023 17:46:19 +0200 Subject: [PATCH 4/4] docs: CLI changelog entry Signed-off-by: F.N. Claessen --- documentation/cli/change_log.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/cli/change_log.rst b/documentation/cli/change_log.rst index c1790976e..3a8b9f2da 100644 --- a/documentation/cli/change_log.rst +++ b/documentation/cli/change_log.rst @@ -4,6 +4,11 @@ FlexMeasures CLI Changelog ********************** +since v0.14.1 | June XX, 2023 +================================= + +* Avoid saving any :abbr:`NaN (not a number)` values to the database, when calling ``flexmeasures add report``. + since v0.14.0 | June 15, 2023 =================================