joke2k / faker

Faker is a Python package that generates fake data for you.
https://faker.readthedocs.io
MIT License
17.55k stars 1.92k forks source link

Undocumented backwards incompatible change to `words` provider in v26.0.0 #2070

Closed gsnider2195 closed 3 weeks ago

gsnider2195 commented 1 month ago

2067 changed the signature of the words provider and removed the part_of_speech kwarg. I know this is a major version change but this wasn't documented in the change log.

Steps to reproduce

  1. Install faker v26.0.0
  2. faker.Faker().words(nb=2, part_of_speech="adjective")

Expected behavior

Works correctly like in v25.9.2:

>>> import faker
>>> faker.Faker().words(nb=2, part_of_speech="adjective")
['active', 'least']

Actual behavior

>>> import faker
>>> faker.Faker().words(nb=2, part_of_speech="adjective")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Provider.words() got an unexpected keyword argument 'part_of_speech'
fcurella commented 1 month ago

I think this is a bug and we can re-introduce part_of_speech back.