-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Conflicting file and directory names cause “Not a directory” errors when a YAML snapshot has data tests #11110
Comments
Thanks for reporting this @michael-domotz ! I was able to reproduce the issue you reported using Note: I got this error if I just did Here's where it happens in the source code:
ReprexCreate these files:
snapshots:
- name: my_snapshot
relation: ref('my_model')
config:
unique_key: id
strategy: check
check_cols: all
columns:
- name: id
data_tests:
- not_null Assuming the table associated with Run these commands: dbt build Get this output:
|
dbt snapshot
and dbt test
create conflicting file and directory with the same name, causing “Not a directory” errors
dbt snapshot
and dbt test
create conflicting file and directory with the same name, causing “Not a directory” errors
I ran into a similar error when attempting to use YML-only config snapshots, though it seems maybe not the exact same? It seems that I cannot put a YML snapshot in a sub-directory, or I get an error like below. I tried removing all tests from the snapshot or just running
|
Is this a new bug in dbt-core?
Current Behavior
When running dbt snapshot followed by dbt test (or vice versa), dbt creates both a file and a directory with the same name under the target/run/ path, leading to a “Not a directory” error during the dbt test step. This results in all tests failing.
Expected Behavior
dbt snapshot and dbt test should not create conflicting file and directory names. Both commands should execute successfully without path conflicts, creating a directory containing the executed code.
Steps To Reproduce
where
_snapshots.yml file
is as follows:dbt snapshot dbt test
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: