# Macro/test takes no keyword argument 'name'

**URL:** <https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928>\
**Category:** Help\
**Tags:** testing, snowflake, macros, dbt-core\
**Created:** [November 24, 2023, 11:19am UTC](https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928 "2023-11-24T11:19:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhildevvr](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@akhildevvr](https://discourse.getdbt.com/u/akhildevvr)\
**Post date:** [November 24, 2023, 11:19am UTC](https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928/1 "2023-11-24T11:19:47Z")

</div>

## The problem I’m having

I am running a dbt built in test named accepted\_values for a column and i am giving the name for the test.  
However when running dbt compile, i am getting below error : **macro ‘dbt\_macro\_\_test\_accepted\_values’ takes no keyword argument ‘name’**.

The name argument is the name of the test in the schema.yml file.

```auto
- name: <column_name>
        description: <desc>
        tests: #Defining the accepted values
          - accepted_values:
              name: <test_name>
              values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

```

## Some example code or error messages

```auto
macro 'dbt_macro__test_accepted_values' takes no keyword argument 'name'
  > in macro test_accepted_values (tests/generic/builtin.sql)

```

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [November 24, 2023, 11:30am UTC](https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928/2 "2023-11-24T11:30:28Z")

</div>

You need to provide the exact YAML definition including spacing of your test, because this is almost certainly a YAML problem

Note: `@Mike Stanley` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1700825421165709?thread_ts=1700824812.617909&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![akhildevvr](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@akhildevvr](https://discourse.getdbt.com/u/akhildevvr)\
**Post date:** [November 24, 2023, 11:31am UTC](https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928/3 "2023-11-24T11:31:39Z")

</div>

hi @a_slack_user , thanks for your help. Please see the above.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [November 24, 2023, 11:33am UTC](https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928/4 "2023-11-24T11:33:41Z")

</div>

Hmm and I see that you did actually do that and Discourse just didn’t render the code block for me, it popped in after I pressed enter! Tests do not actually have a name property, so where you have `name: &lt;test_name&gt;` in your YAML, this isn’t valid. If you look at the example here([https://docs.getdbt.com/reference/resource-properties/tests](https://docs.getdbt.com/reference/resource-properties/tests)), it has a `name` property but it is a property of the column, not of the test. So the `name` is getting passed to your test macro and this is causing an error.

Yes I agree that tests should have names and it’s pretty infuriating that they don’t… but they don’t I’m afraid.

Note: `@Mike Stanley` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1700825614760909?thread_ts=1700824812.617909&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![akhildevvr](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@akhildevvr](https://discourse.getdbt.com/u/akhildevvr)\
**Post date:** [November 24, 2023, 11:44am UTC](https://discourse.getdbt.com/t/macro-test-takes-no-keyword-argument-name/10928/5 "2023-11-24T11:44:40Z")

</div>

Hi @a_slack_user , I beleive one can provide custom name for a test as mentioned here [About tests property | dbt Developer Hub](https://docs.getdbt.com/reference/resource-properties/tests#custom-test-name) in the same link that you provided.
