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

use psycopg2-binary dep #704

Closed
drewbanin opened this issue Mar 26, 2018 · 6 comments
Closed

use psycopg2-binary dep #704

drewbanin opened this issue Mar 26, 2018 · 6 comments

Comments

@drewbanin
Copy link
Contributor

via http://initd.org/psycopg/articles/2018/02/08/psycopg-274-released/

@michael-erasmus
Copy link

michael-erasmus commented Jun 22, 2018

Is this issue on the roadmap? I recently ran into the same error as described here:

#773

As a workaround, I tried cloning dbt locally, manually bumping the version to of psycopg2 to 2.7.5 in setup.py and installing the package locally into a virtualenv.

That did seem to fix the error, and I am able to use this version of dbt to compile and run our dbt projects without any errors.

I'm happy to send along a pull request for this, but I wanted to check if perhaps I should be testing anything else?

@drewbanin
Copy link
Contributor Author

drewbanin commented Jun 23, 2018

@michael-erasmus thanks for the additional info. I'd like to get up-to-date with psycopg2, but we've had some rough experiences bumping deps in the past, so I want to make sure that we're not going to break anything in the process!

I went through the list of changes from psycopg2 v2.7.1 to v2.7.5 (here) and it doesn't look to me like there's anything problematic in there. In fact, I think there are some fixes around closed connections that might help out dbt users with long-running queries.

....

I'm doing some reading about the updates, and I'm seeing some conflicting information on the binary package. The installation docs indicate that the -binary package is not recommended for packages that depend on psycopg2:

Note The -binary package is meant for beginners to start playing with Python and PostgreSQL without the need to meet the build requirements. If you are the maintainer of a publish package depending on psycopg2 you shouldn’t use psycopg2-binary as a module dependency. For production use you are advised to use the source distribution.

But the 2.7.4 article seems to indicate that -binary is suitable for production libs:

if the program works fine with the Wheel packages, and the convenience of the binary distribution is preferred, it is possible to specify the dependency on the binary package using the psycopg2-binary instead of the psycopg2 PyPI package. No change to the program code is needed;

So, I think I'd like to bump to pyscopg2==2.7.5, and hold off on using the pyscopg2-binary distribution for now. Maybe when pyscopg2==2.8 is released, we can revisit.

Definitely keen to hear your thoughts @michael-erasmus. When you installed 2.7.5, did you use psycopg2 or psycopg2-binary?

@michael-erasmus
Copy link

Hey @drewbanin! I installed just psycopg2 (not the binary distribution)

@drewbanin
Copy link
Contributor Author

great, thanks @michael-erasmus. I think that's what we'll do for the next release. Check the above PR for more info :)

Thanks for your help!

@michael-erasmus
Copy link

That's awesome, thanks @drewbanin!

@drewbanin
Copy link
Contributor Author

Merged in #807 - closing

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