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

Fix incorrect name for city New London [id:4839416]. #389

Merged
merged 3 commits into from
Feb 14, 2022

Conversation

Crozzers
Copy link
Contributor

In the old cities.db.bz2 file the record for "New London" [id: 4839416] had the name set incorrectly to "New Londonhttps://www.geonames.org/1524325/ekibastuz.html#", as seen in this screenshot:

image

In the updated cities.db.bz2 file this has been corrected as shown here:

image

Name was previously set to "New Londonhttps://www.geonames.org/1524325/ekibastuz.html#".
It has now been corrected to "New London"
@Crozzers
Copy link
Contributor Author

Crozzers commented Jan 25, 2022

Upon further investigation, it appears that the file that the sqlite database is generated from contains the error. However, since this file is hosted on OpenWeatherMap's servers (http://bulk.openweathermap.org/sample/city.list.json.gz) I am not sure how to fix that.

I have reported this issue via their Ask a question portal

EDIT:
This doesn't seem to just affect the free "sample" data they provide.
image

@csparpa
Copy link
Owner

csparpa commented Jan 27, 2022

@Crozzers good catch, thanks!
I use an automated script to generate CityID files from the JSON file coming from OWM website... this one: https:/csparpa/pyowm/blob/develop/scripts/generate_city_id_files.py

If you manage to regenerate the SQLite DB, that would be great!
Otherwise please tell me and I'll do it as soon as I have time

Thanks so much

@Crozzers
Copy link
Contributor Author

When I made the commit all I did was edit the database itself as I wasn't yet aware that it was auto-generated.

I could tweak the generator to detect URLs in words/invalid words and ask the user for a correction if you think that makes sense

@csparpa
Copy link
Owner

csparpa commented Jan 28, 2022 via email

@Crozzers
Copy link
Contributor Author

I'll start working on that then.

Will check the city's name, country and state for a URL. If one is found, the user will be prompted to
either do nothing, replace the data with generated suggestion or manually enter the data.
@Crozzers
Copy link
Contributor Author

Crozzers commented Jan 28, 2022

I've added the checks for whether an entry contains a URL. It will check each city name, country and state for URLs and suggest a correction if one is found. The user can then either accept or deny the suggestion or manually enter a correction themselves.

I also attempted to enable testing with Python 3.10 but that failed with the following error
AttributeError: 'dict' object has no attribute 'select'
so I rolled back those changes

@Crozzers
Copy link
Contributor Author

Crozzers commented Feb 7, 2022

Quick update, I mentioned previously:

Upon further investigation, it appears that the file that the sqlite database is generated from contains the error. However, since this file is hosted on OpenWeatherMap's servers (http://bulk.openweathermap.org/sample/city.list.json.gz) I am not sure how to fix that.
I have reported this issue via their Ask a question portal

I did receive an email response saying that the developer team has been notified of the error.
Hopefully this means that it will be fixed at some point in the not too distant future but as of the time of writing, it has not.

@csparpa
Copy link
Owner

csparpa commented Feb 7, 2022

Thank you so much @Crozzers for the update, I'll check on your PR as soon as possible

@csparpa csparpa merged commit 55310f1 into csparpa:develop Feb 14, 2022
@csparpa csparpa added this to the 3.3.0 milestone Feb 14, 2022
@csparpa csparpa added the bug label Feb 14, 2022
@csparpa csparpa mentioned this pull request Feb 14, 2022
csparpa added a commit that referenced this pull request Feb 14, 2022
# New features
[380](#380) Implemented [National Weather Alerts](https://openweathermap.org/api/one-call-api#listsource) support
[376](#376) Now PyOWM uses SQLite instead of files to internally store city data. `CityIDRegistry` interface has changed but in a retrocompatible way


# Chores
[381](#381) Now it is possible to specify how many times to retry an API call


# Bugfixes
[379](#379) Experimental fix for `404` errors on Agromonitor API satellite image search 
[387](#387) Fixed lat/lon swap bug on Airpollution API
[389](#389) Fixed wrong city name in City ID database
@Crozzers Crozzers deleted the develop branch February 14, 2022 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants