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

elementary column anomalies tests fail on redshift with error 'Relation name is longer than 127 characters' #695

Closed
MiConnell opened this issue Apr 23, 2024 · 2 comments

Comments

@MiConnell
Copy link
Contributor

Describe the bug
elementary column_anomalies tests are unable to run on Redshift due to table naming length restrictions

To Reproduce
Steps to reproduce the behavior:

  1. add elementary.column_anomalies tests to columns in a dbt model that builds in Redshift
columns:
      - name: id
        tests:
          - elementary.column_anomalies:
              column_anomalies:
                - null_count
                - missing_count
                - average
        description: ''
        meta:
          hidden: true
  1. test the model with dbt test -s my_model

error occurs:

Runtime Error in test elementary_column_anomalies_fact_table_null_count__missing_count__average__success_count (models/marts/fact_table.yml)
Relation name '"test_7ffaec620b_elementary_column_anomalies_fact_table_null_count__missing_count__av__metrics__tmp_20240423000522692548"' is longer than 127 characters

Expected behavior
Tests run successfully and elementary is able to create temp tables

Environment (please complete the following information):

  • dbt package Version: 0.14.1

Additional context
dbt running in prod redshift

@MiConnell
Copy link
Contributor Author

It looks like the problem is it's adding both single and double quotes. the relation name '"<table_name>"' is longer than 127 characters is accurate as it's actually 129 characters. changing this line to 125 fixes it.

MiConnell added a commit to MiConnell/dbt-data-reliability that referenced this issue Apr 23, 2024
haritamar pushed a commit that referenced this issue May 15, 2024
…f duplicate quoting (#696)

explained in [this issue](#695)
@haritamar
Copy link
Collaborator

Hi @MiConnell !
Thanks for opening this issue and the associated PR, and sorry for the delayed response.
I believe the double quoting is likely a bug here, but nonetheless I don't see an issue with reducing the number of characters to 125 for now so I'm going to approve and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants