Hello! I am trying out dbt-core for the first time for a POC project. I am trying to do a very simple example, but I keep running into the same error and cannot find a solution from official documention. The same error appears whether I run dbt test on my source, or if I try to dbt run the model.
THis is the error:
/dbt/compilation.py", line 438, in link_graph
raise RuntimeError("Found a cycle: {}".format(cycle))
RuntimeError: Found a cycle: model.wc_demo.wc_demo_model_1
Can I have help reviewing my following setup to see what mistake I am making?
I have a profile.yml setup in the default user .dbt folder, and connect to snowflake . (I ran dbt debug and connection looks okay)
Here’s the strucuture of my profile.yml:
wc_demo:
outputs:
dev:
account: my_account_name
database: MY_DB
private_key_passphrase: password
private_key_path: /path/to/my/keyfile
role: MY_ROLE
schema: MY_SCHEMA
threads: 1
type: snowflake
user: MY_USER
warehouse: MY_WHS
target: dev
My directory structure looks like this:
Here’s my files defined:
dbt_project.yml
name: wc_demo
version: '1.0.0'
config-version: 2
profile: wc_demo
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target"
clean-targets:
- "target"
- "dbt_packages"
models:
wc_demo:
demo:
materialized: view
packages.yml
packages:
- package: dbt-labs/metrics
version: [">=1.3.0", "<1.4.0"]
packages:
- package: dbt-labs/dbt_utils
version: 0.9.2
models/sources/sources.yml
version: 2
sources:
- name: wc_demo
database: MY_DB
schema: MY_SCHEMA
freshness: # default freshness
warn_after: {count: 12, period: hour}
error_after: {count: 24, period: hour}
loaded_at_field: SNAPSHOT_DATE
description: HERES MY DESCRIPTION
tables:
- name: MY_TABLE_NAME
description: >
Here's a descripton of my table
loaded_at_field: SNAPSHOT_DATE
columns:
- name: uid
description: primary key
tests:
- unique
- not_null
models/demo/demo.yml
version: 2
models:
- name: wc_demo_model_1
description: first demo project
config:
enabled: true
columns:
- name: uid
description: "The primary key for this table"
tests:
- unique
- not_null
models/demo/wc_demo_model_1.sql
select uid
from MY_SCHEMA.MY_TABLE_NAME
Thank you!