Skip to content
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-3010] [Regression] Dbt ls failing to find models when using path selector and project-dir flag #8446

Closed
2 tasks done
jsteele-om1 opened this issue Aug 17, 2023 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists regression

Comments

@jsteele-om1
Copy link

jsteele-om1 commented Aug 17, 2023

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

In upgrading from 1.3 to 1.6, we've noticed an issue with running dbt ls --select <model-path> --project_dir <project> .... It only appears to be this combination that fails to find any models. It works with:

  • dbt build command with project dir flag and path selector
  • dbt ls with model path and no project dir flag
  • dbt ls with project dir flag and specific model selected

Expected Behavior

dbt ls --select <model-path> --project_dir <project> ... select models under <project-dir>/<model-path>

Steps To Reproduce

  1. Sample Environment:
parent_directory/
  sample_project/
    dbt_project.yml
    models/
      example/
        sample_model.sql
  1. cwd = parent_directory: dbt ls --select models/example --project-dir sample_project/ returns: no nodes selected

Relevant log output

18:59:16  Running with dbt=1.6.0
18:59:16  Registered adapter: snowflake=1.6.0
18:59:26  Found nnnn models, nnnn tests, nnnn seeds, nnnn operations, nnnn sources, nnn exposures, nnn metrics, nnnn macros, nnnn groups, nnnn semantic models
18:59:26  The selection criterion 'models/<...>' does not match any nodes
18:59:26  No nodes selected!

Environment

- OS: `Debian GNU/Linux 10 (buster)`
- Python: `3.9.5`
- dbt: `1.6.0`

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

@jsteele-om1 jsteele-om1 added bug Something isn't working triage labels Aug 17, 2023
@github-actions github-actions bot changed the title [Bug] Dbt ls failing to find models when using path selector and project-dir flag [CT-3010] [Bug] Dbt ls failing to find models when using path selector and project-dir flag Aug 17, 2023
@dbeatty10 dbeatty10 self-assigned this Aug 18, 2023
@dbeatty10 dbeatty10 changed the title [CT-3010] [Bug] Dbt ls failing to find models when using path selector and project-dir flag [CT-3010] [Regression] Dbt ls failing to find models when using path selector and project-dir flag Aug 18, 2023
@dbeatty10
Copy link
Contributor

Thanks for reporting this @jsteele-om1 🙏

After testing this out myself, I can verify that using file/fqn syntax like the following works in both 1.5 and 1.6:

dbt ls --project-dir sample_project/
dbt ls --select example --project-dir sample_project/
dbt ls --select file:example.sql --project-dir sample_project/

But path-based selection that worked in 1.5 no longer works in 1.6:

dbt ls --select models/example.sql --project-dir sample_project/
dbt ls --select path:models/example.sql --project-dir sample_project/

I tried using both absolute and relative paths as well as setting the DBT_PROJECT_DIR environment variable, but path-based selection didn't work in 1.6 regardless.

@dbeatty10 dbeatty10 removed the triage label Aug 18, 2023
@dbeatty10 dbeatty10 removed their assignment Aug 18, 2023
@jtcohen6
Copy link
Contributor

Thanks team! This is a duplicate of #8385, and I believe it was fixed in #8388. You can try using v1.5.5 or v1.6.1rc1 to confirm.

@jtcohen6 jtcohen6 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
@jtcohen6 jtcohen6 added the duplicate This issue or pull request already exists label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists regression
Projects
None yet
Development

No branches or pull requests

3 participants