取决于一个名为“energy_dbt_model”的节点,该节点未找到

问题描述 投票:0回答:0

嘿,我是 dbt 的新手,正在尝试找出如何查询我的 duckdb 文件。但是当我运行

dbt run --select energy_dbt_model
。我一直收到错误
Model 'model.transform_dbt.first_model' (models\example\first_model.sql) depends on a node named 'energy_dbt_model' which was not found

这是我的 schema.yml 文件


version: 2

models:
  - name: energy_dbt_model
    description: this dataset holds the data of the captured solar and wind energy also the price and the datetime this data was captured, this dataset has data for every 15 minuts
    columns:
      - name: id
        description: "The primary key for this table"
        tests:
          - unique
          - not_null
      - name: date_time
        description: The datetime the data was captured
        tests:
          - unique
          - not_null
      - name: solar_measured
        description: The amount of solar energy produced in the whole of belgium at the given timestamp
        tests:
          - not_null
      - name: wind_measured
        description: The amount of wind energy produced in Belgium at the given timestamp
        tests:
          - not_null
      - name: solar_price
        description: The calculated price for solar energy at that given timestamp
        tests:
          - not_null
      - name: wind_price
        description: The calculated price for wind energy at that given timestamp
        tests:
          - not_null

这是我的

first_model.sql
,我正在尝试运行。

SELECT * FROM {{ ref('energy_dbt_model') }}

这是我的profiles.yml文件

transform_dbt: # this needs to match the profile in your dbt_project.yml file
  target: dev
  outputs:
    dev:
      type: duckdb
      path: './energy.duckdb'
      extensions:
        - httpfs
        - parquet

这主要是从互联网上复制的我只是更改了路径var.

这是我的 dbt_project.yml 文件。


# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'transform_dbt'
version: '1.0.0'
config-version: 2

# This setting configures which "profile" dbt uses for this project.
profile: 'transform_dbt'

# These configurations specify where dbt should look for different types of files.
# The `model-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

target-path: "target"  # directory which will store compiled SQL files
clean-targets:         # directories to be removed by `dbt clean`
  - "target"
  - "dbt_packages"


# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models

# In this example config, we tell dbt to build all models in the example/
# directory as views. These settings can be overridden in the individual model
# files using the `{{ config(...) }}` macro.
models:
  transform_dbt:
    # Config indicated by + and applies to all files under models/example/
    example:
      +materialized: view

感谢任何帮助,正如我所说,我对 dbt 很陌生,这也可能是一个非常愚蠢的错误。

python yaml etl dbt duckdb
© www.soinside.com 2019 - 2024. All rights reserved.