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

quote: true for column in .yml properties causes tests not to render in TESTS column in the Column table #201

Closed
barberscott opened this issue Jul 8, 2021 · 3 comments · Fixed by #425
Labels
bug Something isn't working Stale

Comments

@barberscott
Copy link

Given model docs_test.sql with:

select 'foo' as "My Space", 'bar' as "NoSpace"

and docs_test.yml with:

version: 2

models:
  - name: docs_test
    columns:  
      - name: My Space
        quote: true
        tests:
        - not_null
      - name: NoSpace
        quote: true
        tests:
        - not_null

a dbt docs generate runs but when I got to view docs I don't see docs for either referenced under the TESTS column in the Columns table in the browser.

This code in the underlying javascript <!-- ngIf: has_test(column, 'N') --> doesn't seem to be able to find the column when quote: true is applied. That source is here..

Screen Shot 2021-07-08 at 4 56 24 PM

Things I tried to work around:

  • Removing quote works for docs, but then breaks the test since I need to preserve lettercase and/or the space here.
  • Adding quotes to name: like "'My Space'" allows the test to work, but results in a double entry in docs.

Screen Shot 2021-07-08 at 5 02 14 PM

@barberscott barberscott added the bug Something isn't working label Jul 8, 2021
@diegodewilde
Copy link
Contributor

Hi @barberscott, we're experiencing the same issue you're describing above.

@kyohei3
Copy link

kyohei3 commented Feb 8, 2022

Same here.

I looked into manifest.json and found that column_names of test resources have quotes, but column_names of models does not. As a result, this code return false and tests column becomes empty.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2022

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 8, 2022
jtcohen6 pushed a commit that referenced this issue Jun 9, 2023
* (#201) Fix for column tests not rendering on quoted columns

* Add support for bigquery quotes

* use backticks for databricks and spark; add compat module and test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants