faker_fdw icon indicating copy to clipboard operation
faker_fdw copied to clipboard

TypeError calling seed in Faker 4.1.1

Open W1M0R opened this issue 5 years ago • 6 comments

Given the following SQL:

select "name" from fake.person;

I get the following error in the Postgres logs:

Error in python: TypeError


File "/usr/local/lib/python3.7/dist-packages/faker_fdw/__init__.py", line 53, in __init__
faker.seed(self.seed)
File "/usr/local/lib/python3.7/dist-packages/faker/proxy.py", line 83, in __getattribute__
raise TypeError(msg)
TypeError: Calling `.seed()` on instances is deprecated. Use the class method `Faker.seed()` instead.

My environment uses Python 3.7 and Faker version 4.1.1 (https://pypi.org/project/Faker/4.1.1/)

Relevant information about the breaking change in Faker can be found here: https://github.com/joke2k/faker/blob/master/docs/fakerclass.rst

W1M0R avatar Jul 08 '20 12:07 W1M0R

Did you find any solution for this issue. I am also having the same problem. Any help would be appreciated.

praseetha-nair avatar Jul 10 '20 05:07 praseetha-nair

I decided not to use this fdw, instead opting to use Faker directly, via the plpython3u postgres extension.

If you would like to use this fdw, then the other solution would be to specify the exact version of Faker when you install it. I'm not sure which version is required, but you can try Faker version 2.0.4.

W1M0R avatar Jul 10 '20 08:07 W1M0R

Maybe 5960995763f2486ec796b58281e70f3ecbde8f8f fixed this? I accepted that PR.

guedes avatar Jul 10 '20 21:07 guedes

It does look like that would have resolved the issue. I followed the installation instructions in the README. Does the currently tagged release contain that PR?

W1M0R avatar Jul 13 '20 14:07 W1M0R

The fix is currently merged on default (master) but no release of it was made. With the new release tag link, we can update the installation instructions with the new link.

@guedes can you release a new tag with the fix?

By the way, thanks a lot for this project!

matheuslc avatar May 17 '21 23:05 matheuslc

Thanks all for testing. Bumped, tagged and pushed! Hope this work for you now. :blue_heart:

guedes avatar May 23 '21 01:05 guedes