guedes / faker_fdw

Because, sometimes, your Elephant must lie
Other
89 stars 7 forks source link

TypeError calling seed in Faker 4.1.1 #6

Open W1M0R opened 4 years ago

W1M0R commented 4 years ago

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

praseetha-nair commented 4 years ago

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

W1M0R commented 4 years ago

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.

guedes commented 4 years ago

Maybe 5960995763f2486ec796b58281e70f3ecbde8f8f fixed this? I accepted that PR.

W1M0R commented 4 years ago

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?

matheuslc commented 3 years ago

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!

guedes commented 3 years ago

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