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

Generating dummy country data with mimesis only returns 'United States' #1344

Closed
rgoubet opened this issue Apr 14, 2023 · 8 comments
Closed

Comments

@rgoubet
Copy link

rgoubet commented Apr 14, 2023

Bug report

What's wrong

Address.country appears to return only United States:

from mimesis import Address

g = Address()
for i in range(0,11):
    print(g.country())

This returns 10 times United States. This is unlike:

g = Address()
for i in range(0,6):
    print(g.city())

Which returns 5 different city names.

How is that should be

I should get 5 different country names (in English).

System information

3.11.3 | packaged by conda-forge | (main, Apr 6 2023, 08:50:54) [MSC v.1934 64 bit (AMD64)]
Mimesis 7.1.0

@lk-geimfari
Copy link
Owner

You have to pass allow_random=True, like this:

address.country(allow_random=True)

See: https://mimesis.name/en/master/api.html#mimesis.Address.country

@lk-geimfari
Copy link
Owner

I'm going to change this behavior in upcoming release, to make country() return random country each time.

@rgoubet
Copy link
Author

rgoubet commented Apr 14, 2023

Great, thank you!

@lk-geimfari
Copy link
Owner

I've fixed this behavior.

There are two methods now:

country() always returns random country
default_country() always returns country associated with current locale i.e United States for en, Россия for ru

@lk-geimfari
Copy link
Owner

I will release 8.0.0 later this month.

@lk-geimfari
Copy link
Owner

I've fixed this one in 8.0.0 which is already available on PyPi, btw.

@rgoubet
Copy link
Author

rgoubet commented Apr 19, 2023

Yes, it was even available in Conda Forge on the same day. Tested and loving it. Thanks for your blazing-fast resolution!

@lk-geimfari
Copy link
Owner

@rgoubet You're welcome! Thank you for your interest!

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

No branches or pull requests

2 participants