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

Allow empty task id in entity statuses for new geopoint #1822

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

Sujanadh
Copy link
Contributor

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Whenever new geopoint is introduced it won't have task_id since we don't have task_id filter any more so there won't be task id for new feature which resulted into validation error in entity statuses endpoint.

Unrelated to entity statuses , I encountered an issue in preview_split_by_square where aoi is changed when single polygon is uploaded.

Actual AOI:
image

After merge_polygons:
Screenshot from 2024-10-16 10-52-52

Describe this PR

This PR updates the schema EntityTaskID and EntityOsmID in order to allow empty task_id and osm_id which likely occurs if new feature geopoint is introduced in submissions. This PR also updates the function preview_split_by_square where the length of polygon is checked before in order to apply merge_polygons only for multipolygon aoi.

This PR depends on the new release of osm-fieldwork for the creation of new entity id for new feature geopoint.

Screenshots

N/A

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Notes for the reviewer. How to test this change?

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@Sujanadh Sujanadh added priority:high Should be addressed as a priority dependency:osm-fieldwork Requires updates in osm-fieldwork labels Oct 16, 2024
@Sujanadh Sujanadh requested a review from spwoodcock October 16, 2024 05:16
@Sujanadh Sujanadh self-assigned this Oct 16, 2024
@github-actions github-actions bot added bug Something isn't working backend Related to backend code labels Oct 16, 2024
@Sujanadh Sujanadh marked this pull request as draft October 16, 2024 11:15
@spwoodcock
Copy link
Member

Very nice use of Pydantic πŸ‘

@spwoodcock spwoodcock changed the base branch from staging to development October 18, 2024 09:16
@spwoodcock spwoodcock changed the base branch from development to staging October 18, 2024 09:17
@spwoodcock spwoodcock merged commit 7586178 into staging Oct 18, 2024
7 checks passed
@spwoodcock spwoodcock deleted the fix/entity-statuses branch October 18, 2024 09:20
spwoodcock pushed a commit that referenced this pull request Oct 18, 2024
…#1822)

* fix: allow empty task-id in entity statuses

* fix: apply merge polygon function only if multipolygon

* fix: use field validator and convert str values to int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code bug Something isn't working dependency:osm-fieldwork Requires updates in osm-fieldwork priority:high Should be addressed as a priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants