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-1282] [Bug] Cannot reference a Source containing a dot (.) in node selection #5980

Closed
2 tasks done
rossserven opened this issue Oct 1, 2022 · 4 comments
Closed
2 tasks done
Labels
enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation

Comments

@rossserven
Copy link

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

Trying to reference a Source through node selection and I’m running into an issue because our sources contain periods. e.g.:

sources:
  - name: raw.test
    database: 'RAW'
    schema: 'TESTING'
    tables:
      - name: TEST_TABLE

so this doesn’t work: source:raw.test.TEST_TABLE
however if it’s defined as:

sources:
  - name: test
    database: 'FIVETRAN_RAW'
    schema: 'TESTING'
    tables:
      - name: TEST_TABLE

this works: source:test.TEST_TABLE

Expected Behavior

sources:
  - name: raw.test
    database: 'RAW'
    schema: 'TESTING'
    tables:
      - name: TEST_TABLE

this should work (or optionally enclosed with quotes): source:raw.test.TEST_TABLE

Steps To Reproduce

  1. define a Source with a dot/period
  2. Attempt to reference that source in node selection

Relevant log output

[0m15:38:00 No nodes selected!
[0m15:38:00 'source:raw.test.TEST_TABLE' does not match any nodes

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

@rossserven rossserven added bug Something isn't working triage labels Oct 1, 2022
@github-actions github-actions bot changed the title [Bug] Cannot reference a Source containing a dot (.) in node selection [CT-1282] [Bug] Cannot reference a Source containing a dot (.) in node selection Oct 1, 2022
@lostmygithubaccount
Copy link
Contributor

hi @rossserven, thanks for opening this issue. I think it's related to #1269, tagging @jtcohen6 for his input -- it looks like this is how dbt has been for a long time so I'm going to classify this as an enhancement rather than a bug.

@jtcohen6 should we close as a duplicate in favor of #1269, or is this different? I don't see a lot of discussion about sources in that issue

@jtcohen6 jtcohen6 added user docs [docs.getdbt.com] Needs better documentation Team:Language and removed triage Team:Execution labels Oct 31, 2022
@jtcohen6
Copy link
Contributor

The ability to use dots in some resource names is something that's, at best, semi-supported within dbt today. We don't (to my knowledge) document that you can definitely do this, but last year a community member did add tests for models with dots in their names (#3247) to ensure that we didn't accidentally regress on this capability in future versions.

I do see the connection to #1269, insofar as the dot-in-model-name approach (dynamically stripped to form schema.alias combos) was following this pattern, and originally motivated by the lack of namespacing support within dbt: https://discourse.getdbt.com/t/extracting-schema-and-model-names-from-the-filename/575

We simply must add namespacing support next year. #1269 is the oldest and narrowest version of that issue, but the way I want to see us doing this is by:

All that being said: @rossserven Could I ask what your purpose is behind naming a source raw.test, instead of (e.g.) raw__test? Is it essential to your use case that the name contain dots? Or is this just something you'd expected to work, and we should more clearly document that it doesn't?

@jtcohen6 jtcohen6 removed their assignment Oct 31, 2022
@rossserven
Copy link
Author

@jtcohen6 there was no requirement/purpose for raw. we just used that notation and at the time didn't see or read any limitations around it. we can work to move to a new standard without the dot since this is now known.

@lostmygithubaccount
Copy link
Contributor

I've opened a docs issue to track potential improvements, going to close this one out @rossserven

@lostmygithubaccount lostmygithubaccount closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2022
@jtcohen6 jtcohen6 removed the triage label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

No branches or pull requests

3 participants