DBT和Google Cloud Composer PYPI依赖性问题

发布于 2025-01-22 00:02:13 字数 636 浏览 4 评论 0 原文

我目前正在使用Composer版本 2.0.9 和AirFlow版本 2.1.4 运行Google Cloud Composer。我正在尝试安装DBT的最新版本( 1.0.4 for Core和 1.0.0 for BigQuery插件)。由于云堆积器图像已安装了特定的软件包,因此我遇到了矛盾的PYPI依赖性问题。当我尝试解决一个依赖关系时,发生另一个问题。有人知道安装了解决此问题的特定软件包集吗?我已经阅读了社区的以下帖子,但是我想知道是否有人有解决作曲家的解决方案?

如何使用Google Cloud进行DBT作曲家?

I am currently running Google Cloud Composer with a Composer version 2.0.9 and airflow version 2.1.4. I am trying install the most recent version of dbt (1.0.4 for core and 1.0.0 for the BigQuery plugin). Because cloud composter images has specific packages installed, I am getting conflicting PyPI dependency issues. When I try to fix one dependency another issue occurs. Does anyone know the specific set of packages installed that would resolve this issue? I have read the following posts by the community but I wanted to know if anyone has a solution for just using composer?

How to run DBT in airflow without copying our repo

How to set up dbt with Google Cloud Composer?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

没有伤那来痛 2025-01-29 00:02:14

我能够复制您所看到的行为。以下是我在云构建日志中看到的依赖关系冲突。这些冲突发生在 dbt-core 要求与作曲家中的预安装程序包要求之间发生。

预安装的软件包要求

hologram 0.0.14 has requirement jsonschema<3.2,>=3.0, but you have jsonschema 3.2.0. ##=> can be installed manually
flask 1.1.4 has requirement click<8.0,>=5.1, but you have click 8.1.2.
apache-airflow 2.1.4+composer has requirement markupsafe<2.0,>=1.1.1, but you have markupsafe 2.0.1.
looker-sdk 22.4.0 has requirement typing-extensions>=4.1.1, but you have typing-extensions 3.10.0.2.

dbt-core要求

hologram 0.0.14 has requirement jsonschema<3.2,>=3.0, but you have jsonschema 3.2.0. ##=> can be installed manually
dbt-core 1.0.4 has requirement click<9,>=8, but you have click 7.1.2.
dbt-core 1.0.4 has requirement MarkupSafe==2.0.1, but you have markupsafe 1.1.1.
dbt-core 1.0.4 has requirement typing-extensions<3.11,>=3.7.4, but you have typing-extensions 4.1.1.

我尝试降级预安装的软件包,但随后的软件包安装失败,它是也不建议

因此,我建议使用 您已经链接了。引用@Ryan Yuan在此处的答案中给出的解决方法。

  1. 使用外部服务运行DBT作业,例如云运行。
  2. 使用作曲家的话语在这里进行设置过程。
  3. 通过将作曲家的环境变量设置为true来忽略作曲家的依赖关系冲突。
    但是,我不建议这样做,因为这可能会引起潜在的问题。
  4. 在作曲家中创建Python虚拟环境并安装DBT软件包。

I was able to reproduce the behaviour you are seeing. Below are the dependency conflicts I saw in the Cloud Build logs. These conflicts are occurring between the dbt-core requirements and the pre-installed package requirements in Composer.

Pre-installed package requirements:

hologram 0.0.14 has requirement jsonschema<3.2,>=3.0, but you have jsonschema 3.2.0. ##=> can be installed manually
flask 1.1.4 has requirement click<8.0,>=5.1, but you have click 8.1.2.
apache-airflow 2.1.4+composer has requirement markupsafe<2.0,>=1.1.1, but you have markupsafe 2.0.1.
looker-sdk 22.4.0 has requirement typing-extensions>=4.1.1, but you have typing-extensions 3.10.0.2.

dbt-core requirements:

hologram 0.0.14 has requirement jsonschema<3.2,>=3.0, but you have jsonschema 3.2.0. ##=> can be installed manually
dbt-core 1.0.4 has requirement click<9,>=8, but you have click 7.1.2.
dbt-core 1.0.4 has requirement MarkupSafe==2.0.1, but you have markupsafe 1.1.1.
dbt-core 1.0.4 has requirement typing-extensions<3.11,>=3.7.4, but you have typing-extensions 4.1.1.

I tried downgrading the pre-installed packages, but subsequent package installations fail and it is not recommended as well.

Therefore, I would suggest using an external solution as stated in this thread you have linked. Quoting the workarounds given in @Ryan Yuan's answer here.

  1. Using external services to run dbt jobs, e.g. Cloud Run.
  2. Using Composer's KubernetesPodOperator(updated Composer 2 link). My colleague has put up a nice article on dbt discourse here going through the setup process.
  3. Ignoring Composer's Dependency conflicts by setting Composer's environmental variable IGNORE_PYPI_DEPENDENCY_CONFLICTS to True.
    However, I don't recommend this as it may cause potential issues.
  4. Creating a Python virtual environment in Composer and install the dbt packages.
北城半夏 2025-01-29 00:02:14

正如@Kabilan Mohanraj提到的,当前版本的DBT(1.0.4)和最新版的作曲家具有依赖性问题(Composer版本2.0.9和AirFlow版本2.1.4)。因此,需要替代解决方案。就我而言,我玩耍并搜索了社区中其他人的解决方案,发现一个人使用某种版本的作曲家和DBT,而作曲家和DBT只有模仿依赖性问题。但是,正如@Kabilan Mohanraj所提到的,Google不建议降低预装的包装,因此对于生产中的某些东西来说,这将不是可行的解决方案。

不可用的旧版本

gcloud composer environments create my_airflow_dbt_example
--location us-central1
--image-version composer-1.17.9-airflow-2.1.4

通过GCLOUD创建作曲家,使用该特定作曲家版本的Composer UI要求

dbt-bigquery==0.21.0
jsonschema==3.1.1
packaging==20.9

,您正在降级 JSonschema 3.2.0 3.1.1 包装来自 21.3 to 20.9

As mentioned by @Kabilan Mohanraj, the current version of dbt (1.0.4) and a more recent version of Composer has dependency issues (Composer version 2.0.9 and Airflow version 2.1.4). Therefore an alternative solution is needed. In my case, I played around and searched for a solution from other people in the community and found one person using a certain version of Composer and dbt that only had mimimal dependency issues. However, as mentioned by @Kabilan Mohanraj, Google does not recommend downgrading preinstalled packages, so this would not be a viable solution for something in production.

create composer through gcloud to use an older version that is not available via the Composer UI

gcloud composer environments create my_airflow_dbt_example
--location us-central1
--image-version composer-1.17.9-airflow-2.1.4

requirements

dbt-bigquery==0.21.0
jsonschema==3.1.1
packaging==20.9

For this specific composer version, you are downgrading jsonschema from 3.2.0 to 3.1.1 and packaging from 21.3 to 20.9

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文