# unit test: numeric column name in source

**URL:** <https://discourse.getdbt.com/t/unit-test-numeric-column-name-in-source/20011>\
**Category:** Help\
**Tags:** testing, dbt-core\
**Created:** [August 1, 2025, 2:34pm UTC](https://discourse.getdbt.com/t/unit-test-numeric-column-name-in-source/20011 "2025-08-01T14:34:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian1](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Florian1](https://discourse.getdbt.com/u/Florian1)\
**Post date:** [August 1, 2025, 2:34pm UTC](https://discourse.getdbt.com/t/unit-test-numeric-column-name-in-source/20011/1 "2025-08-01T14:34:42Z")

</div>

## The problem I’m having

I want to write a unit test for a dbt model. However, one of the source tables has columns with numbers as name, e.g. “200”.  
The unit test results in an error, since it tries to run this sql query:

```auto
select
try_cast('123' as character varying(16777216))
as othercolumn,
try_cast(null as character varying(1))
     as 200

```

## The context of why I’m trying to do this

I cannot change the source table, so I have to live with numbers as column names.

## What I’ve already tried

I tried to explicitly assign the columns a value in input, although they are not used in my model

```auto
      - input: source('SOURCE_SCHEMA', 'SOURCE_TABLE')
        rows:
          - othercolumn: '123'
            "200": 0

```

This has no effect. The sql still looks like this:

```auto
select
try_cast('123' as character varying(16777216))
as othercolumn,
try_cast('0' as character varying(1))
     as 200

```

## Error messages

```auto
14:05:10 Runtime Error in unit_test ut_mymodel (models\mymodel.yml)
  An error occurred during execution of unit test 'ut_mymodel'. There may be an error in the unit test definition: check the data types.
   Database Error
    001003 (42000): SQL compilation error:
    syntax error line 110 at position 8 unexpected '200'.

```

## My Question

Is there a way to use numbers as column names in dbt unit tests? For example, is there a setting to force quotes around column names in the compiled unit test code?

---

<div class="post-metadata">

**Author:** ![Florian1](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Florian1](https://discourse.getdbt.com/u/Florian1)\
**Post date:** [August 4, 2025, 3:14pm UTC](https://discourse.getdbt.com/t/unit-test-numeric-column-name-in-source/20011/2 "2025-08-04T15:14:32Z")

</div>

Topic is not relevant for me anymore: Source change the names of the columns to start with letters.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [August 11, 2025, 3:14pm UTC](https://discourse.getdbt.com/t/unit-test-numeric-column-name-in-source/20011/3 "2025-08-11T15:14:59Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
