Closed mikealfare closed 5 months ago
cc: @dbeatty10 @jtcohen6 as they probably have some context
This would be a departure for users' current install behavior as it will require people to have OS dependencies preinstalled (i.e. a C compiler, various libs etc) so we'll need to pair this with a docs update (something we'll need to do anyways as part of decoupling)
My typical instinct is to preserve whatever the current behavior is. In this case, that would be keeping psycopg2-binary
within the dependencies, and adding psycopg2
to the optional dependencies.
What would be the advantages of the proposed order of psycopg2
as the default and psycopg2-binary
as optional?
having given this some thought I think I agree, ultimately for production use cases users should install psycopg2
as it's significantly more performant however for users installing locally (and for our testing environments) psycopg2-binary
is the better choice as it requires the least amount of configuration and is faster to install.
I've updated the ticket to reflect the proposal. Default to psycopg2-binary
to maintain consistency and avoid compiling psycopg2
every time; offer psycopg2
as an extra.
We'll want to add some kind of guidance in the v1.8 migration guide.
We don't have the DBT_PSYCOPG2_NAME
environment variable documented in that many places:
So we could probably just say something like this:
Some folks may be using the DBT_PSYCOPG2_NAME
environment variable to install psycopg2
instead of psycopg2-binary
, possibly like this:
DBT_PSYCOPG2_NAME=psycopg2 pip install dbt
This has been replaced with the following instead:
pip install dbt-postgres[compile]
I added the user docs
label. I feel like we should add that on the dbt-postgres
section of docs.getdbt.com.
Closing for Colin
Assuming https://github.com/dbt-labs/dbt-postgres/pull/41 resolved this?
If so, will there actually be a behavior change between versions of dbt-postgres that we need to add to a migration guide (requiring user_docs
)?
Or does https://github.com/dbt-labs/dbt-postgres/pull/41 just preserve the behavior of dbt-postgres when it was in the dbt-core repo?
Is this your first time submitting a feature request?
Describe the feature
In the
dbt-core
repo,dbt-postgres
has a conditional build dependency forpsycopg2
.dbt-postgres
defaults topsycopg2-binary
unless overridden by an environment variable. With the move topyproject.toml
, we'll need a different way to handle this.Proposal
Default to
psycopg2-binary
in the primary build dependencies. Offerpsycopg2
via an optional extra.pyproject.toml
would look like this:This would offer the following installation options:
pip install dbt-postgres
: usepsycopg2-binary
pip install dbt-postgres[no-binary]
: usepsycopg2
Who will this benefit?
This provides flexibility for folks installing
dbt-postgres
. Some users need the binary version ofpsycopg2
to avoid installing other build tooling. This is ideal for development. Others need the source version ofpsycopg2
so that it gets compiled to their machine. This is ideal for production.