Skip to content

Commit

Permalink
Backport PR #735: fix: drop NaN values when saving the report to the …
Browse files Browse the repository at this point in the history
…database (#735)

* fix: drop NaN values when saving the report to the database

Signed-off-by: F.N. Claessen <felix@seita.nl>

* docs: changelog entry

Signed-off-by: F.N. Claessen <felix@seita.nl>

* docs: explain abbreviation

Signed-off-by: F.N. Claessen <felix@seita.nl>

* docs: CLI changelog entry

Signed-off-by: F.N. Claessen <felix@seita.nl>

---------

Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Jun 26, 2023
1 parent 986c057 commit 285e79f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/changelog.rst
Expand Up @@ -10,6 +10,7 @@ Bugfixes
-----------

* Relax constraint validation of `StorageScheduler` to accommodate violations caused by floating point precision [see `PR #731 <https://www.github.com/FlexMeasures/flexmeasures/pull/731>`_]
* Avoid saving any :abbr:`NaN (not a number)` values to the database, when calling ``flexmeasures add report`` [see `PR #735 <https://www.github.com/FlexMeasures/flexmeasures/pull/735>`_]
* Fix browser console error when loading asset or sensor page with only a single data point [see `PR #732 <https://www.github.com/FlexMeasures/flexmeasures/pull/732>`_]


Expand Down
5 changes: 5 additions & 0 deletions documentation/cli/change_log.rst
Expand Up @@ -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
=================================

Expand Down
4 changes: 2 additions & 2 deletions flexmeasures/cli/data_add.py
Expand Up @@ -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.",
Expand Down

0 comments on commit 285e79f

Please sign in to comment.