Skip to content

[BUG] incorrectly identifying column names with "_" #489

@davidggphy

Description

@davidggphy

Describe the bug
When running dbt-coves generate properties selecting Update all, I get new lines in the documentation with non-existing columns.

Original documentation (including only part of the columns):

version: 2

models:
  - name: stg_mysql_client
    description: ""
    columns:
      - name: account_
        data_type: STRING

After running the command:
Original documentation (including only part of the columns):

version: 2

models:
  - name: stg_mysql_client
    description: ""
    columns:
      - name: account_
        data_type: STRING
      - name: account

Same happens with other models containing columns ending in _, like letters_. Since dbt-coves is not able to properly identify the name of these columns.

To Reproduce
Steps to reproduce the behaviour:

  1. Create model test_model.sql containing:
select 1 as test_column,
         2 as test_column_,
         3 as another_col_
  1. Compile it dbt run -s test_model
  2. Generate documentation dbt-coves generate properties --select test_model

You obtain test_model.ylm:

version: 2

models:
  - name: test_model
    description: ""
    columns:
      - name: test_column
      - name: test_column
      - name: another_col

Expected behaviour

Obtain a documentation file test_model.ylm:

version: 2

models:
  - name: test_model
    description: ""
    columns:
      - name: test_column
      - name: test_column_
      - name: another_col_

Desktop (please complete the following information):

  • OS: iOS
  • Browser: N/A
  • Version 14.5
  • dbt-coves v1.8.0
  • dbt v1.8.3
  • connector: bigquery

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationtriaged: noHasn't been approved for future implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions