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

433 delete sensor #784

Merged
merged 9 commits into from Aug 2, 2023
Merged

433 delete sensor #784

merged 9 commits into from Aug 2, 2023

Conversation

GustaafL
Copy link
Contributor

@GustaafL GustaafL commented Aug 2, 2023

Description

Adds an API endpoint to delete a sensor

Look & Feel

sensors/<id> DELETE

Related Items

This PR closes issue #433


  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

GustaafL added 5 commits August 2, 2023 15:22
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
@GustaafL GustaafL marked this pull request as ready for review August 2, 2023 15:14
@GustaafL GustaafL requested a review from nhoening August 2, 2023 15:14
GustaafL added 2 commits August 2, 2023 17:18
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

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

Looks good to me, aside from a small test improvement.

I actually checked if our data model cascades deletion to beliefs, but it doesn't look like it. (for reference, the asset deletion cascade is here)

But that's not a problem of this endpoint Your test shows it's happening.

flexmeasures/api/v3_0/tests/test_sensors_api.py Outdated Show resolved Hide resolved
GustaafL and others added 2 commits August 2, 2023 21:33
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
@nhoening nhoening merged commit ad1c345 into 433-patch-sensor Aug 2, 2023
3 of 4 checks passed
@nhoening nhoening deleted the 433-delete-sensor branch August 2, 2023 20:21
nhoening added a commit that referenced this pull request Aug 2, 2023
* feat(sensors): adds fetch_one sensor endpoint to API

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensors): adds post sensor to API

Signed-off-by: GustaafL <guus@seita.nl>

* post sensor still needs work

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): adds post sensor

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): changes the docstring of the post function

Signed-off-by: GustaafL <guus@seita.nl>

* clearer names for the arguments to permission_required_for_context decorator, especially arg_loader was misleading

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* one more renaming

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* expanding possibilities in the require_permission_for_context decorator, for when we only have an AuthModelMixin ID.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* feat(sensor): post sensor without schema changes

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): adds patch sensor

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): change importin users services

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): update changelogs and fix import

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): update failing test

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): tests for patching excluded attributes and no auth

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): remove NewDurationField since it's unused

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): removes print statement

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): test if database changed after patch

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): tests for patch response json

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): updates docstrings patch sensor

Signed-off-by: GustaafL <guus@seita.nl>

* tests(sensor): test for updating fields that are not allowed and improved docs

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): updated api changelog typo

Signed-off-by: GustaafL <guus@seita.nl>

* feat(sensor): add id field(dump_only) to schema and response json

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): edit docstrings to include id in example response

Signed-off-by: GustaafL <guus@seita.nl>

* 433 delete sensor (#784)

* feat(sensor): adds delete sensor endpoint

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): updated api changelog

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): updated api changelog whitespace

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): updated api changelog missing /

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): update changelog

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): update changelog typo

Signed-off-by: GustaafL <guus@seita.nl>

* docs(sensor): update changelog missing space

Signed-off-by: GustaafL <guus@seita.nl>

* tests(sensor): check for float instead of exact value

Signed-off-by: GustaafL <guus@seita.nl>

---------

Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>

---------

Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
Co-authored-by: Nicolas Höning <nicolas@seita.nl>
@GustaafL GustaafL added this to the 0.15.0 milestone Aug 3, 2023
@GustaafL GustaafL linked an issue Aug 3, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CRUD endpoints to Sensor API
2 participants