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-3167] [Bug] resource_type selector method not returning expected results #8730

Closed
2 tasks done
dave-connors-3 opened this issue Sep 27, 2023 · 8 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@dave-connors-3
Copy link
Contributor

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

using dbt ls -s resource_type:source returns no results in a project with sources, while dbt ls --resource-type source properly returns expected results

image

Expected Behavior

each method should return all sources defined in my project

Steps To Reproduce

  1. define a source
  2. run dbt ls -s resource_type:source , see nothing
  3. run dbt ls --resource-type source see source node

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

@dave-connors-3 dave-connors-3 added bug Something isn't working triage labels Sep 27, 2023
@github-actions github-actions bot changed the title [Bug] resource_type selector method not returning expected results [CT-3167] [Bug] resource_type selector method not returning expected results Sep 27, 2023
@graciegoheen
Copy link
Contributor

Thanks for opening Dave! I agree, according to our docs, this should work.

I think the next step is to check if the resource_type selector is working in earlier versions - is this also not working in 1.5? 1.4?

@dbeatty10
Copy link
Contributor

I was able to reproduce that this doesn't work in dbt-core 1.6. Now we just need to see if it worked on 1.5 or 1.4.

@dbeatty10 dbeatty10 removed the triage label Sep 27, 2023
@jtcohen6
Copy link
Contributor

I am not sure if this actually ever worked!

It looks like the code was added multiple years ago, but the docs only very recently:

I agree it would be nice if it did work, within --select syntax, for all commands (even ones that don't support the --resource-type parameter).

@graciegoheen
Copy link
Contributor

@jtcohen6 do you know why do we have both?

@jtcohen6
Copy link
Contributor

@graciegoheen I think just history, and it's worth making this more consistent. In theory we support:

dbt ls --select source:*
dbt ls --resource-type source

I don't know if we've ever actually supported:

dbt ls --select resource_type:source

@dbeatty10
Copy link
Contributor

Opened this issue to clarify what works currently and what doesn't:

@dbeatty10
Copy link
Contributor

Although this doesn't work in 1.5.9, it did for me using 1.6.5 and 1.7.8:

(dbt_1.5) $ dbt ls -s resource_type:source              

02:02:21  Running with dbt=1.5.9
02:02:21  Registered adapter: postgres=1.5.9
02:02:22  Found 2 models, 1 test, 1 snapshot, 1 analysis, 310 macros, 0 operations, 1 seed file, 1 source, 1 exposure, 0 metrics, 1 group
02:02:22  The selection criterion 'resource_type:source' does not match any nodes
02:02:22  No nodes selected!

(dbt_1.6) $ dbt ls -s resource_type:source

02:02:45  Running with dbt=1.6.5
02:02:45  Registered adapter: postgres=1.6.5
02:02:45  Unable to do partial parsing because of a version mismatch
02:02:46  Found 2 models, 1 snapshot, 1 analysis, 1 seed, 1 test, 1 source, 1 exposure, 0 metrics, 352 macros, 1 group, 0 semantic models
source:my_project.my_src.my_seed

(dbt_1.7) $ dbt ls -s resource_type:source

02:03:03  Running with dbt=1.7.8
02:03:03  Registered adapter: postgres=1.7.8
02:03:03  Unable to do partial parsing because of a version mismatch
02:03:04  Found 2 models, 1 snapshot, 1 analysis, 1 seed, 1 test, 1 source, 1 exposure, 0 metrics, 401 macros, 1 group, 0 semantic models
source:my_project.my_src.my_seed

Quickly scanning the changelogs for 1.6 and 1.7, I don't know what changed to cause this to work now though.

I'm going to close this as "magically resolved". If someone knows the right PR to link this to, please share! 🙏

Also opened dbt-labs/docs.getdbt.com#5003 to update the docs.

@graciegoheen
Copy link
Contributor

@dbeatty10 We should make sure we have a test in place so that this doesn't "magical break" in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants