Skip to content

Remove duplicates #452

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

Merged
merged 4 commits into from
May 15, 2025
Merged

Remove duplicates #452

merged 4 commits into from
May 15, 2025

Conversation

peterdudfield
Copy link
Collaborator

@peterdudfield peterdudfield commented May 15, 2025

Pull Request

Description

Occacisioanly there are multe value for target_time, gsp_id, and model_name in the forecast_value_latest. This can happen when we upgrade a model, then the API will provide this duplicates when

  • pulling national data with include_data
  • non compact for forecast/all.
  • but not for all other routes

This PR solves that
Helps solve #450

Speed did not significantly change

How Has This Been Tested?

  • CI test
  • tested locally

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@peterdudfield peterdudfield marked this pull request as ready for review May 15, 2025 07:12
@peterdudfield peterdudfield requested a review from braddf May 15, 2025 07:12
Copy link
Contributor

@braddf braddf left a comment

Choose a reason for hiding this comment

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

Yep, you've already left a comment re this (nowcasting_api/utils.py#L225) so yep although this works, this is another code smell for me that we're having to do these sorts of things on the API side and not in the DB queries, so another one to think about for future

@peterdudfield peterdudfield merged commit a7f0b53 into main May 15, 2025
2 checks passed
@peterdudfield peterdudfield deleted the remove-duplicates branch May 15, 2025 10:16
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.

2 participants