Closed adamantike closed 1 year ago
Thanks for the detailed report. I've opened a PR to address this issue: we can keep both the dependency group for tests/development and re-add the adapters back to the main dependencies group.
A bit of history on 06e6025
:
The idea of dropping adapters from dependencies was to simplify version resolution: Airflow and dbt-core already contain a lot of dependencies and adding adapters on top of that was making things worse.
However, now that we have dropped support for Airflow 1, I'm not seeing any version conflicts, except for having to set an upper boundary on Python <4.0 (see bottom for a note on upper boundaries). And version resolution is not too bad (took about 3.5 minutes on my machine, when it used to take >40 minutes when supporting Airflow 1). I've been playing around with pdm as of late, so I'll test out if migrating to that can result in quicker version resolution.
In retrospective, I do regret including adapters as dependencies in the first place: I intended them as a shortcut when installing airflow-dbt-python, but I didn't realize at the time that we were placing the burden of resolving dependencies on airflow-dbt-python. Sometimes we can run airflow-dbt-python even with conflicts, as the conflict could be in dbt-core's CLI logic or other parts we don't access (I wish dbt-core offered a light library alternative, there are some ongoing efforts apparently, and dbt-core is particularly aggressive with pinning its dependencies sometimes). So it doesn't make much sense for us to carry that burden.
However, it has become a bit of a feature at this point and I rather not break existing users while it's not a big problem. That being said, as a feature, this is lacking proper testing...
A note on upper boundaries: I dislike upper boundaries except when completely necessary, even on something still far into the future as Python <4.0, but I recognize it's a small cost to pay for now.
As an example, before this PR we only had one upper boundary on pytest-postgresql = ">=3,<4"
as newer versions of pytest-postgresql
break our tests because they rely on psycopg3
.
Description
With the changes introduced in v1.0.0 (specifically, in commit https://github.com/tomasfarias/airflow-dbt-python/commit/06e60258e9e1ff5e028b72047c406747b8f36924), specifying this package's extras does not install the optional dependencies.
It gets fixed when adding these lines back to the
[tool.poetry.dependencies]
section inpyproject.toml
:This makes sense according to Poetry documentation:
However, I haven't created a PR for this, because I see that commit also created a Poetry
adapters
group, which could get broken with this change. Related Poetry issue: https://github.com/python-poetry/poetry/issues/4891#issuecomment-993816696Steps to reproduce
pip install 'airflow-dbt-python[snowflake] == 1.0.0'
.dbt-snowflake
, by runningpip freeze | grep dbt-snowflake
.Additional context
Installing version
0.15.3
correctly installs provided extras:For version
1.0.0
, that's no longer the case: