【问题标题】:How can I get dbt working on my Mac targeting Databricks如何让 dbt 在我的 Mac 上以 Databricks 为目标工作
【发布时间】:2022-10-22 17:26:33
【问题描述】:

我使用我的 Macbook Pro 针对 Databricks 开发 DBT 模型。一切都运行良好,但我不能独自离开,最近运行“dbt update”,发现一堆东西已经过时了。过去我遇到过升级我的 Python(通过 Brew 安装)的问题,所以我避免升级 Python,而是升级了 SQLite。显然,升级 Python 是一个依赖项并且升级了 Python。因此,DBT 不再有效。

经过大量搜索,我跑了

brew remove dbt
brew install dbt

因为brew install dbt 告诉我安装 dbt-labs/dbt/dbt 已被弃用,我转而运行brew install dbt-postgre 计算我将以这种方式安装核心 DBT 文件。

然后根据https://github.com/databricks/dbt-databricks,我跑了

pip install dbt-databricks

除了关于“distutils 配置文件已弃用”的标准警告之外,一切似乎都很好,等等......

现在,我运行dbt debug,我得到了

Running with dbt=1.2.2
dbt version: 1.2.2
python version: 3.9.14
python path: /opt/homebrew/Cellar/dbt-postgres/1.2.2/libexec/bin/python
os info: macOS-12.6-arm64-arm-64bit
Using profiles.yml file at /Users/andrewpark/.dbt/profiles.yml
Using dbt_project.yml file at /Users/andrewpark/iCloud Drive (Archive)/Documents/Work >Projects/Github Source/data-platform/transformation/databricks-dbt/dbt_project.yml

18:24:13  target not specified in profile 'databricks_sql', using 'default'
18:24:13  Error importing adapter: No module named 'dbt.adapters.databricks'
Configuration:
  profiles.yml file [ERROR invalid]
  dbt_project.yml file [OK found and valid]

Required dependencies:
 - git [OK found]

1 check failed:
Profile loading failed for the following reason:
Runtime Error
  Credentials in profile "databricks_sql", target "default" invalid: Runtime Error
    Could not find adapter type databricks!

我根本没有碰过我的profiles.yml 文件,所以没有任何改变,但它说该文件无效。在我看来,dbt-databricks找不到适配器。我该如何解决这个问题?

操作系统:MacOS 蒙特雷 12.6
Python版本:3.10.7
DBT 版本(核心):1.2.2

另外,我已经安装了 dbt-snowflake 和 dbt-postgres 适配器以及 dbt-databricks,但是当我运行 dbt --version 时,这些适配器没有出现,只有 Postgres 1.2.2 插件。

【问题讨论】:

    标签: python macos homebrew databricks dbt


    【解决方案1】:

    配置profile.yml

    your_profile_name:
      target: dev
      outputs:
        dev:
          type: databricks
          catalog: 
          schema: 
          host: 
          http_path: 
          token: 
    

    【讨论】:

    • 您好@Romerito Morais,感谢您的回复。我的 profile.yml 已经使用为 SQL Warehouse/Endpoint 定义的正确主机、http_path 和令牌进行了配置。正如我上面提到的。在 Python 升级之前,我的 DBT 的 CLI 版本曾经在 Databricks 上运行良好。
    猜你喜欢
    • 2022-10-24
    • 1970-01-01
    • 1970-01-01
    • 2023-01-27
    • 1970-01-01
    • 2020-01-23
    • 2019-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多