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

Tag --store-failures ambiguous error #100

Closed
diegorech opened this issue Sep 29, 2022 · 1 comment
Closed

Tag --store-failures ambiguous error #100

diegorech opened this issue Sep 29, 2022 · 1 comment

Comments

@diegorech
Copy link

diegorech commented Sep 29, 2022

Hi guys, so i think this issue could be linked with: #96 but:

When we try to run dbt test using the flag --store-failures twice, in the second run we got the same

"When searching for a relation, dbt found an approximate match. Instead of guessing
14:18:09    which relation to use, dbt will move on."

error that happens when we tryied to insert into an incremental model like mentioned on #96 .

The log:

First run

(venv) diegorech@PMNPOA263:/repos/dbt/project$ dbt test --select models/marts/pref_seller --vars '{"database": "test", "profile":"general-dev", "config_id": "cbd91059-645f-4bc8-8c25-...." }' --store-failures
14:16:07  Running with dbt=1.2.1
14:16:13  Found 33 models, 11 tests, 0 snapshots, 0 analyses, 336 macros, 0 operations, 0 seed files, 16 sources, 0 exposures, 0 metrics
14:16:13
14:16:16  Concurrency: 1 threads (target='dev')
14:16:16
14:16:16  1 of 9 START test assert_pref_seller_should_be_right_with_last_and_standart_seller_config_standart_seller_  [RUN]
14:16:18  1 of 9 PASS assert_pref_seller_should_be_right_with_last_and_standart_seller_config_standart_seller_  [PASS in 2.23s]
14:16:18  2 of 9 START test not_null_standart_seller_PID ................................. [RUN]
14:16:20  2 of 9 PASS not_null_standart_seller_PID ....................................... [PASS in 1.61s]
14:16:20  3 of 9 START test not_null_standart_seller_PREF_SELLER_STORE ................... [RUN]
14:16:21  3 of 9 PASS not_null_standart_seller_PREF_SELLER_STORE ......................... [PASS in 1.57s]
14:16:21  4 of 9 START test relationships_standart_seller_PREF_SELLER_STORE__ORDER_STORE__source_prod_ORDER_ITEMS_  [RUN]
14:16:23  4 of 9 PASS relationships_standart_seller_PREF_SELLER_STORE__ORDER_STORE__source_prod_ORDER_ITEMS_  [PASS in 1.96s]
14:16:23  5 of 9 START test relationships_standart_seller_PREF_SELLER_STORE__STORE_ID__source_prod_AVAILABLE_SELLERS_360_  [RUN]
14:16:25  5 of 9 PASS relationships_standart_seller_PREF_SELLER_STORE__STORE_ID__source_prod_AVAILABLE_SELLERS_360_  [PASS in 1.97s]
14:16:25  6 of 9 START test relationships_standart_seller_PREF_SELLER__AVAILABLE_ENROLMENT__source_prod_AVAILABLE_SELLERS_360_  [RUN]
14:16:27  6 of 9 PASS relationships_standart_seller_PREF_SELLER__AVAILABLE_ENROLMENT__source_prod_AVAILABLE_SELLERS_360_  [PASS in 2.01s]
14:16:27  7 of 9 START test relationships_standart_seller_PREF_SELLER__PRODUCT_SELLER__source_prod_ORDER_ITEMS_  [RUN]
14:16:29  7 of 9 PASS relationships_standart_seller_PREF_SELLER__PRODUCT_SELLER__source_prod_ORDER_ITEMS_  [PASS in 1.99s]
14:16:29  8 of 9 START test set_orderby_should_return_rows_in_order_standart_seller_ ..... [RUN]
14:16:32  8 of 9 PASS set_orderby_should_return_rows_in_order_standart_seller_ ........... [PASS in 2.78s]
14:16:32  9 of 9 START test set_top_should_return_n_rows_standart_seller_ ................ [RUN]
14:16:35  9 of 9 PASS set_top_should_return_n_rows_standart_seller_ ...................... [PASS in 2.60s]
14:16:35
14:16:35  Finished running 9 tests in 0 hours 0 minutes and 21.88 seconds (21.88s).
14:16:35
14:16:35  Completed successfully
14:16:35
14:16:35  Done. PASS=9 WARN=0 ERROR=0 SKIP=0 TOTAL=9

After that the result table have been created on database_dbt_test__audit

Second run, in the same database with no changes:

(venv) diegorech@PMNPOA263:/repos/dbt/project$ dbt test --select models/marts/pref_seller --vars '{"database": "test", "profile":"general-dev", "config_id": "cbd91059-645f-4bc8-8c25-...." }' --store-failures
14:17:47  Running with dbt=1.2.1
14:17:51  Found 33 models, 11 tests, 0 snapshots, 0 analyses, 336 macros, 0 operations, 0 seed files, 16 sources, 0 exposures, 0 metrics
14:17:51  
14:17:54  Concurrency: 1 threads (target='dev')
14:17:54  
14:17:54  1 of 9 START test assert_pref_seller_should_be_right_with_last_and_standart_seller_config_standart_seller_  [RUN]
14:17:56  1 of 9 PASS assert_pref_seller_should_be_right_with_last_and_standart_seller_config_standart_seller_  [PASS in 2.01s]
14:17:56  2 of 9 START test not_null_standart_seller_PID ................................. [RUN]
14:17:56  2 of 9 ERROR not_null_standart_seller_PID ...................................... [ERROR in 0.05s]
14:17:56  3 of 9 START test not_null_standart_seller_PREF_SELLER_STORE ................... [RUN]
14:17:56  3 of 9 ERROR not_null_standart_seller_PREF_SELLER_STORE ........................ [ERROR in 0.13s]
14:17:56  4 of 9 START test relationships_standart_seller_PREF_SELLER_STORE__ORDER_STORE__source_prod_ORDER_ITEMS_  [RUN]
14:17:58  4 of 9 PASS relationships_standart_seller_PREF_SELLER_STORE__ORDER_STORE__source_prod_ORDER_ITEMS_  [PASS in 1.95s]
14:17:58  5 of 9 START test relationships_standart_seller_PREF_SELLER_STORE__STORE_ID__source_prod_AVAILABLE_SELLERS_360_  [RUN]
14:18:00  5 of 9 PASS relationships_standart_seller_PREF_SELLER_STORE__STORE_ID__source_prod_AVAILABLE_SELLERS_360_  [PASS in 1.98s]
14:18:00  6 of 9 START test relationships_standart_seller_PREF_SELLER__AVAILABLE_ENROLMENT__source_prod_AVAILABLE_SELLERS_360_  [RUN]
14:18:02  6 of 9 PASS relationships_standart_seller_PREF_SELLER__AVAILABLE_ENROLMENT__source_prod_AVAILABLE_SELLERS_360_  [PASS in 1.93s]
14:18:02  7 of 9 START test relationships_standart_seller_PREF_SELLER__PRODUCT_SELLER__source_prod_ORDER_ITEMS_  [RUN]
14:18:04  7 of 9 PASS relationships_standart_seller_PREF_SELLER__PRODUCT_SELLER__source_prod_ORDER_ITEMS_  [PASS in 1.95s]
14:18:04  8 of 9 START test set_orderby_should_return_rows_in_order_standart_seller_ ..... [RUN]
14:18:06  8 of 9 PASS set_orderby_should_return_rows_in_order_standart_seller_ ........... [PASS in 2.60s]
14:18:06  9 of 9 START test set_top_should_return_n_rows_standart_seller_ ................ [RUN]
14:18:09  9 of 9 PASS set_top_should_return_n_rows_standart_seller_ ...................... [PASS in 2.87s]
14:18:09  
14:18:09  Finished running 9 tests in 0 hours 0 minutes and 18.51 seconds (18.51s).
14:18:09  
14:18:09  Completed with 2 errors and 0 warnings:
14:18:09
14:18:09  Compilation Error in test not_null_standart_seller_PID (models/marts/pref_seller/schema.yml)
14:18:09    When searching for a relation, dbt found an approximate match. Instead of guessing
14:18:09    which relation to use, dbt will move on. Please delete database_dbt_test__audit.not_null_standart_seller_PID, or rename it to be less ambiguous.
14:18:09    Searched for: database_dbt_test__audit.not_null_standart_seller_pid
14:18:09    Found: database_dbt_test__audit.not_null_standart_seller_PID
14:18:09
14:18:09    > in macro materialization_test_default (macros/materializations/tests/test.sql)
14:18:09
14:18:09  Compilation Error in test not_null_standart_seller_PREF_SELLER_STORE (models/marts/pref_seller/schema.yml)
14:18:09    When searching for a relation, dbt found an approximate match. Instead of guessing
14:18:09    which relation to use, dbt will move on. Please delete database_dbt_test__audit.not_null_standart_seller_PREF_SELLER_STORE, or rename it to be less ambiguous.
14:18:09    Searched for: database_dbt_test__audit.not_null_standart_seller_pref_seller_store
14:18:09    Found: database_dbt_test__audit.not_null_standart_seller_PREF_SELLER_STORE
14:18:09
14:18:09    > in macro materialization_test_default (macros/materializations/tests/test.sql)
14:18:09    > called by test not_null_standart_seller_PREF_SELLER_STORE (models/marts/pref_seller/schema.yml)
14:18:09
14:18:09  Done. PASS=7 WARN=0 ERROR=2 SKIP=0 TOTAL=9

One thing we noticed is that the relationship tests uses an UID-like as suffix and those null value tests don't but some of ours custom tests don't use that ID too and with those we don't had no problems.

We don't know what could caused this in our tests.

image

@genzgd
Copy link
Contributor

genzgd commented Oct 30, 2022

This looks like it's related to model names with upper case characters (PREF_SELLER_STORE). It should be fixed in dbt-clickhouse 1.3. In general I'd recommend using all lower case for models regardless.

@genzgd genzgd closed this as completed Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants