Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Materialized tests do not work #24

Open
nicoweidner opened this issue Sep 29, 2023 · 2 comments
Open

Materialized tests do not work #24

nicoweidner opened this issue Sep 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@nicoweidner
Copy link
Contributor

Trying to run a materialized test leads to the following error:

12:09:48  Completed with 1 error and 0 warnings:
12:09:48  
12:09:48  Compilation Error in macro decodable__create_table_as (macros/materializations/table/create_table_as.sql)
12:09:48    macro 'dbt_macro__decodable__create_table_as' takes not more than 3 argument(s)
12:09:48    
12:09:48    > in macro create_table_as (macros/materializations/models/table/create_table_as.sql)
12:09:48    > called by macro statement (macros/etc/statement.sql)
12:09:48    > called by macro materialize_test_as_table (macros/materializations/test/test_as_table.sql)
12:09:48    > called by macro materialization_test_decodable (macros/materializations/test/test.sql)
12:09:48    > called by macro decodable__create_table_as (macros/materializations/table/create_table_as.sql)

Looking at the code, I see that the create_table_as macro takes only 3 arguments, while the test_as_table macro tries to call it with 4

@nicoweidner nicoweidner added the bug Something isn't working label Sep 29, 2023
@nicoweidner
Copy link
Contributor Author

It looks like even when removing the 4th argument from the test_as_table macro, it still fails because the target stream that is created is an append stream, and the pipeline that is created produces changes events that cannot be entered into this stream.

To verify this, I manually created the target stream as a change stream and removed the code raising an error if the target stream cannot be created. This resolved the issue, but surfaced another one (see next post).

@nicoweidner
Copy link
Contributor Author

When the pipeline for a materialized test is activated, it uses starting position latest. While this is in line with the interpretation of materialized tests as continuous testing of the model, it is different from the behavior when not materializing the test and surprised me at first. In my opinion, it would be desirable to either start from earliest or at least make it configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant