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

Error parsing manifest file with list-type values in YAML config #70

Open
DimitriSam opened this issue Dec 18, 2023 · 1 comment
Open

Comments

@DimitriSam
Copy link

Description

I encountered an issue with the dbt-coverage package where the manifest file cannot be parsed properly. The error occurs in a specific function handling column names.

Steps to Reproduce

  • Command run: dbt-coverage compute doc --model-path-filter model/test.sql
  • Relevant code snippet:
│ 241 │ if not column_name: │
│ 242 │ continue │
│ 243 │ │
│ 244 │ column_name = column_name.lower() │
│ 245 │ table_tests = tests.setdefault(table_id, {}) │
│ 246 │ column_tests = table_tests.setdefault(column_name, []) │
│ 247 │ column_tests.append(node)
  • Error Message: AttributeError: 'list' object has no attribute 'lower'

Expected Behavior

Ideally, the function should be able to handle column names defined as lists without throwing an error.

Environment

  • dbt-coverage version: "0.3.5"
  • dbt version: "1.6.6"
  • Python version: "3.8.12"

Additional Context

The issue arises when defining values as lists in YAML configuration. Example:

snapshots:
  - name: example_snapshot
    tests:
      - custom_test:
          column_name: [modified_column]
          unique_key: example_key
@DimitriSam DimitriSam changed the title Error parsing manifest file with list-type column names Error parsing manifest file with list-type values in YAML config Dec 18, 2023
@mrshu
Copy link
Contributor

mrshu commented Apr 15, 2024

Thanks for the report and your patience @DimitriSam!

This is the first time, however, that I see a list of column names in the definition of tests -- could you please paste a link to the docs where it would explicitly say something like this is supported?

Thanks!

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