You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some users have been using that description with their own generic tests already prior to this. Therefore, when upgrading from a previous version, say from 1.7 to 1.9, we run into a situation where an error arise.
Expected Behavior
No errors.
Steps To Reproduce
dbt project setup:
# dbt_project.ymlname: my_dbt_projectprofile: allversion: "1.0.0"config-version: 2models:
my_dbt_project:
+materialized: table# models/schema.ymlversion: 2models:
- name: foocolumns:
- name: idtests:
- my_custom_test:
description: This is a test to test something.
-- tests/generic/my_custom_test.sql
{%- test my_custom_test(model, column_name, description) -%}
{{ config(meta = {'whats_this_for': description}) }}
select1as c
{%- endtest -%}
-- models/foo.sqlselect1 id
Fwiw - debugging this problem was a super cumbersome - because the error doesn't quite point to the issue. In a project with many hundreds of models, schema yml files, macros, etc - you will never be able to find the problem as easily as described here. You will need to remove all of your project code (packages, models, yaml, macros, etc) and add things back one at a time.
The text was updated successfully, but these errors were encountered:
jeremyyeo
changed the title
[Bug] TypeError: can not serialize 'Undefined' object if generic test takes in arg description which is used in the generic config block
[Bug] TypeError: can not serialize 'Undefined' object if generic test takes in arg description which is used in the generic test config block
Jan 23, 2025
Thank you for diagnosing the root cause here. We have a couple ideas here:
Improving this general exception message ("TypeError: can not serialize 'Undefined' object") such that it is contextualized to indicate which manifest field(s?) is causing things to blow up
parsing the jinja AST while we are building generic test nodes to understand whether 'description' is an expected kwarg for the generic test and should thus be left in as a kwarg in the node.
I'll create separate spikes for both of these ideas.
Is this a new bug in dbt-core?
Current Behavior
On 1.9, we started supporting the
description
property:https://docs.getdbt.com/docs/dbt-versions/2024-release-notes#october-2024
Some users have been using that
description
with their own generic tests already prior to this. Therefore, when upgrading from a previous version, say from 1.7 to 1.9, we run into a situation where an error arise.Expected Behavior
No errors.
Steps To Reproduce
Relevant log output
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
The workaround is to rename
description
to something else...Fwiw - debugging this problem was a super cumbersome - because the error doesn't quite point to the issue. In a project with many hundreds of models, schema yml files, macros, etc - you will never be able to find the problem as easily as described here. You will need to remove all of your project code (packages, models, yaml, macros, etc) and add things back one at a time.
The text was updated successfully, but these errors were encountered: