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

[DISCO-3247] fix: weather pathfinder to use region when None #800

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

tiftran
Copy link
Contributor

@tiftran tiftran commented Feb 19, 2025

References

JIRA: DISCO-3247

Description

We tried to be fancy and it sort of bit us. We can't iterate over a map twice, so I swapped the two for loops. so we can keep map. In theory there's only a small number of edge cases where the first iteration is not successful and we would have more iterations then if the for loop order was swapped

PR Review Checklist

Put an x in the boxes that apply

  • This PR conforms to the Contribution Guidelines
  • The PR title starts with the JIRA issue reference, format example [DISCO-####], and has the same title (if applicable)
  • [load test: (abort|skip|warn)] keywords are applied to the last commit message (if applicable)
  • Documentation has been updated (if applicable)
  • Functional and performance test coverage has been expanded and maintained (if applicable)

@@ -66,109 +66,31 @@ def test_compass(location: Location, expected_region_and_city: str) -> None:


@pytest.mark.parametrize(
("weather_context", "expected_calls"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the actual list of weather contexts, as it only returns the state of the weather context after all the calls and it's actually not useful

@tiftran tiftran requested a review from a team February 19, 2025 21:25
Copy link
Contributor

@ncloudioj ncloudioj left a comment

Choose a reason for hiding this comment

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

Good catch.

@tiftran tiftran force-pushed the bug-no-region branch 2 times, most recently from 056ce44 to aa903c8 Compare February 20, 2025 04:37
@@ -729,7 +729,7 @@ async def get_location_by_geolocation(
"""
geolocation = weather_context.geolocation
country = geolocation.country
city = geolocation.city
city = weather_context.selected_city
Copy link
Contributor Author

Choose a reason for hiding this comment

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

realized we still had weird behaviour because selected_city wasn't used in the actual api call

@tiftran tiftran requested a review from ncloudioj February 20, 2025 18:20
@tiftran tiftran added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit d0712d4 Feb 20, 2025
11 checks passed
@tiftran tiftran deleted the bug-no-region branch February 20, 2025 23:14
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