Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drop NaN values when saving the report to the database #735

Merged
merged 5 commits into from Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/changelog.rst
Expand Up @@ -23,6 +23,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>`_]


v0.14.0 | June 15, 2023
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