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-3240] fix: merino weather to use corrected cities #795

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

tiftran
Copy link
Contributor

@tiftran tiftran commented Feb 14, 2025

References

JIRA: DISCO-3240

Description

Cities that require correction weren't used

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)

@@ -19,7 +18,6 @@
CITY_NAME_CORRECTION_MAPPING: dict[str, str] = {
"Baie Ste. Anne": "Baie-Sainte-Anne",
"Bogota D.C.": "Bogota",
"Collingwood": "Collingwood Corner",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are multiple "Collingwood"s in Canada, so we can't fix the NS one this way

@tiftran tiftran requested a review from a team February 14, 2025 20:46
# map is lazy, so items of `cities` would only be evaluated one by one if needed
cities = map(lambda fn: fn(city), CITY_NAME_NORMALIZERS)
explored_cities: list[str] = [] # store the explored cities to avoid duplicates
city = geolocation.city
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: let's add an early return here if city is None and then do:

city: str = typing.cast(str, geolocation.city)  # `city` would never be None.

No moreif city: needed below.

Copy link
Contributor Author

@tiftran tiftran Feb 14, 2025

Choose a reason for hiding this comment

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

makes sense. Linter said city: str = typing.cast(str, geolocation.city) this was redundant though with the early return.

@tiftran tiftran added this pull request to the merge queue Feb 14, 2025
Merged via the queue into main with commit a5e5345 Feb 14, 2025
11 checks passed
@tiftran tiftran deleted the fix-corected-cities branch February 14, 2025 22:26
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