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

Generate project location string in model_validator #1534

Merged
merged 1 commit into from
May 23, 2024

Conversation

spwoodcock
Copy link
Member

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

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

Related Issue

Fixes #1388

Describe this PR

  • We were chaining three computed_field:
    outline_geojson --> outline --> centroid --> location_str

  • Perhaps this was causing an issue, or there is a bug in Pydantic 🀷

  • Moved the location_str validation to a model_validator, so it runs after all the other fields are computed / validated at the end.

  • Should hopefully fix missing location strings.

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?

@spwoodcock spwoodcock added bug Something isn't working backend Related to backend code labels May 22, 2024
@spwoodcock spwoodcock requested a review from Sujanadh May 22, 2024 14:46
@spwoodcock spwoodcock self-assigned this May 22, 2024
@spwoodcock spwoodcock merged commit bd9b506 into development May 23, 2024
5 checks passed
@spwoodcock spwoodcock deleted the fix/location-str branch May 23, 2024 09:50
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Location extraction isn't visible on project cards
2 participants