-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
@@ -66,109 +66,31 @@ def test_compass(location: Location, expected_region_and_city: str) -> None: | |||
|
|||
|
|||
@pytest.mark.parametrize( | |||
("weather_context", "expected_calls"), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
merino/providers/suggest/weather/backends/accuweather/pathfinder.py
Outdated
Show resolved
Hide resolved
056ce44
to
aa903c8
Compare
…er.py Co-authored-by: Nan Jiang <[email protected]>
aa903c8
to
35973f9
Compare
b4e7cd2
to
f38b185
Compare
@@ -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 |
There was a problem hiding this comment.
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
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[DISCO-####]
, and has the same title (if applicable)[load test: (abort|skip|warn)]
keywords are applied to the last commit message (if applicable)