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

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jun 19, 2023

I'm actually considering moving this logic (of dropping NaNs before saving the data to the database) into save_to_db, but I feel that might constitute a more impactful change then needed for this fix. What do you think, @victorgarcia98? Do you see any use for supporting saving NaN values to the database?

For anyone impacted by this: there already exists a CLI command for removing NaN values from the database: see flexmeasures delete nan-beliefs.

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added bug Something isn't working CLI Reporting labels Jun 19, 2023
@Flix6x Flix6x added this to the 0.14.1 milestone Jun 19, 2023
@Flix6x Flix6x self-assigned this Jun 19, 2023
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Copy link
Contributor

@victorgarcia98 victorgarcia98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Not sure about moving the dropna to save_to_db.

For instance, in some places could have another column for the values with some NaN and dropping the NaN would drop, by default, any column having any NaN.

To fix this, we should use subset=["event_value"] to make sure that we only take the column event_value into account.

Regarding the the use case of storing NaN to the database, I think that as long as we can save a database with an irregular sampling rate, we are good to go.

@Flix6x Flix6x merged commit e8c4688 into main Jun 20, 2023
7 checks passed
@Flix6x Flix6x deleted the bug/drop-nan-report-values branch June 20, 2023 11:06
Flix6x added a commit that referenced this pull request Jun 26, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI Reporting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants