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: deprecated decorator wasn't returning the value of the moved cal… #678

Merged
merged 4 commits into from May 11, 2023

Conversation

victorgarcia98
Copy link
Contributor

While trying to the decorator @deprecated to refactor a function signature, I realized that is not returning the value of the function, just calling it.

This bug affects the following functions:

  • flexmeasures.data.queries.data_sources:get_or_create_source
  • flexmeasures.data.queries.data_sources:get_source_or_none
  • flexmeasures.data.services.asset_grouping:get_asset_group_queries

and methods:

  • flexmeasures.data.models.planning:Scheduler.compute_schedule
  • flexmeasures.data.models.planning:storage:StorageScheduler.compute_schedule

This is specially concerning for code extending from Scheduler.

…lable.

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
Signed-off-by: Victor Garcia Reolid <victor@seita.nl>
@nhoening
Copy link
Contributor

Great catch!

Hm, so this affects functions we are not using internally anymore, but it might have led to errors in other people's code, who have been using them, correct? Something that easily slips your own testing, of course, if you're not using them anymore :/

In my eyes, maybe the scheduling ones have a small likelihood that this actually happened.
Have we officially released this broken deprecation in version 0.13?

@nhoening
Copy link
Contributor

In that case, we might want to add this to version 0.13.1. @Flix6x knows how that works.

@victorgarcia98
Copy link
Contributor Author

Hm, so this affects functions we are not using internally anymore, but it might have led to errors in other people's code, who have been using them, correct?

That's correct, this affects external code.

Have we officially released this broken deprecation in version 0.13?

yes, we have 😞, see here.

Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

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

🥇

@Flix6x Flix6x added this to the 0.13.1 milestone May 11, 2023
@victorgarcia98 victorgarcia98 merged commit 8f97abd into main May 11, 2023
7 checks passed
@victorgarcia98 victorgarcia98 deleted the hotfix/return-value-deprecated branch May 11, 2023 14:48
Flix6x pushed a commit that referenced this pull request May 12, 2023
…e of the moved cal… (#678)

* fix: deprecated decorator wasn't returning the value of the moved callable.

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* fix: update test to check that the decorator is returning

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

* docs: add changelog entry

Signed-off-by: Victor Garcia Reolid <victor@seita.nl>

---------

Signed-off-by: Victor Garcia Reolid <victor@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants