-
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
[CT-2688] [Regression] Can no longer target analysis in a selection #7849
Comments
@moltar I'm not able to reproduce this locally: # dbt_project.yml
name: ...
profile: ...
analysis-paths: ["analysis"] -- analysis/my_analysis.sql
-- {{ run_started_at }}
select 1 as id $ dbt compile -s "analysis/"
14:04:10 Running with dbt=1.5.1
14:04:10 Found 1 model, 0 tests, 0 snapshots, 1 analysis, 307 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics, 1 group
14:04:10
14:04:11 Concurrency: 5 threads (target='dev')
14:04:11 -- target/compiled/my_dbt_project/analysis/my_analysis.sql
-- 2023-06-13 14:04:10.765988+00:00
select 1 as id |
Were you using a project_dir that's not the root directory of your project? This might be another example of #7819. |
Yes!! 😁 export DBT_PROJECT_DIR="sub/dir/dbt"
export DBT_PROFILES_DIR="$DBT_PROJECT_DIR"
dbt compile --select "analysis/" |
@moltar I re-created a dbt project with environment variables similar to #7819, and all of the following worked for me when using dbt~=1.5.0 if I removed the trailing slash: dbt compile --select analysis and dbt compile --select analysis --project-dir $DBT_PROJECT_DIR and dbt compile --select analysis --project-dir $DBT_PROJECT_DIR --profiles-dir $DBT_PROFILES_DIR But using a trailing slash didn't work for me in dbt v1.4 or v1.5 🤷 (Using double quotes or not didn't affect my results.) Could you give it a shot without the trailing slash and see if it works or not? |
Hey @dbeatty10, thanks for the tip! No slash does indeed work. 🎉 I thought I'd tried everything, including that 😁 Other things I tried were using Btw, for posterity, if anyone comes across this, one other thing needed in 1.5, for those who do not have dbt in the root: export DBT_TARGET_PATH="$DBT_PROJECT_DIR/target" This is due to a bug. |
Awesome, great news @moltar 🎉
Is #7465 the bug you are referring to? If so, you can try out the 1.5.2rc1 release candidate which should include a fix for that issue. Assuming we have everything covered, I'm going to close this issue as resolved. But please let me know if not, and I'll be happy to re-open. |
Yes, that's the one.
So, is not including the slash the solution? If so, to be clear, dbt used to work with the slash, wondering if this would be a regression for others. Or is the fix for no slash is part of the 1.5.2rc1 release too? Thanks. |
Is this a new bug in dbt-core?
Current Behavior
This no longer works in 1.5.1:
dbt compile --select "analysis/"
However, if I run without the
--select
:The analysis are found and are compiled.
Expected Behavior
To support the selection of
analysis
as a path.Steps To Reproduce
Run:
dbt compile --select "analysis/"
Observe that
target/*/analysis
is empty.Relevant log output
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
This selection method worked from at least 1.3.0 to 1.4.6.
The text was updated successfully, but these errors were encountered: