dbt-labs / dbt-labs/dbt-codegen

`case_sensitive_cols` parameter for generating unit tests via `generate_unit_test_template`

Open
#255 1 comment 0 reactions 0 assignees View on GitHub
case_sensitivity enhancement Stale
Dominant language
Makefile
Stars
676
Forks
132
PR merge metrics
No merged PRs in 30d

Description

### Describe the feature

There is a `case_sensitive_cols` parameter for both [`generate_source`](https://github.com/dbt-labs/dbt-codegen?tab=readme-ov-file#generate_source-source) and [`generate_base_model`](https://github.com/dbt-labs/dbt-codegen?tab=readme-ov-file#generate_base_model-source) that indicates whether you want column names to be in lowercase, or to match the case from the source relation (only if True).

We want to do this for [`generate_unit_test_template`](https://github.com/dbt-labs/dbt-codegen?tab=readme-ov-file#generate_unit_test_template-source) too.

### Describe alternatives you've considered

If we don't implement this, then there will be no way to support case-sensitive column names.

This is okay for now, because dbt unit tests don't support case-sensitive column names yet:
- https://github.com/dbt-labs/dbt-adapters/issues/205
- https://github.com/dbt-labs/dbt-core/issues/10112

See https://github.com/dbt-labs/dbt-adapters/pull/204 for an open PR.

### Additional context

Here is a related issue: https://github.com/dbt-labs/dbt-codegen/issues/254

### Who will this benefit?

This is only relevant to folks that use all of the following:
- unit tests
- codegen to scaffold unit tests
- case-sensitive column names

### Are you interested in contributing this feature?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.