Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Case sensitive naming leads to a "When searching for a relation, dbt found an approximate match" error #858

Closed
flunardelli opened this issue May 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@flunardelli
Copy link

Describe the bug
Using sql server adapter with a database.schema.table in PascalCase leads a relationship error when I try rerun a dbt-fal python model.

Your environment

  • OS: MacOS / Windows / Linux
Completed with 1 error and 0 warnings:
  
20:00:58.046485 [debug] [MainThread]: Command end result
20:00:58.056627 [info ] [MainThread]: 
20:00:58.056918 [info ] [MainThread]: Completed with 1 error and 0 warnings:
20:00:58.057071 [info ] [MainThread]: 
20:00:58.057227 [error] [MainThread]: Compilation Error in model Int_Base_FalTest (models/intermediate/Base/Int_Base_FalTest.py)
20:00:58.057377 [error] [MainThread]:   When searching for a relation, dbt found an approximate match. Instead of guessing 
20:00:58.057500 [error] [MainThread]:   which relation to use, dbt will move on. Please delete "AdventureWorksDW2019"."EDWStaging"."Int_Base_FalTest", or rename it to be less ambiguous.
20:00:58.057635 [error] [MainThread]:   Searched for: "adventureworksdw2019"."edwstaging"."int_base_faltest"
20:00:58.057753 [error] [MainThread]:   Found: "AdventureWorksDW2019"."EDWStaging"."Int_Base_FalTest"
20:00:58.057881 [error] [MainThread]:   
20:00:58.057996 [error] [MainThread]:   > in macro is_incremental (macros/materializations/models/incremental/is_incremental.sql)
20:00:58.058124 [error] [MainThread]:   > called by macro py_script_postfix (macros/python_model/python.sql)
20:00:58.058248 [error] [MainThread]:   > called by model Int_Base_FalTest (models/intermediate/Base/Int_Base_FalTest.py)
20:00:58.058386 [info ] [MainThread]: 
20:00:58.058520 [info ] [MainThread]: Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1
20:00:58.058712 [debug] [MainThread]: Flushing usage events

dbt-fal==1.4.8
dbt-core==1.4.6
  • Adapter being used:
    dbt-sqlserver==1.4.3
    How to reproduce
    Create an sql server model using PascalCase naming. Run it once and try update it after that.

Expected behavior
A model been updated without this relation search error

Actual behavior
Compilation Error

Additional context
It works on dbt-core, dbt-fal and dbt-sqlserver 1.3.x series.

@flunardelli flunardelli added the bug Something isn't working label May 27, 2023
@chamini2
Copy link
Member

chamini2 commented Jun 1, 2023

Hello, @flunardelli, this should be fixed by @mederka 's PR and is now released in https://pypi.org/project/dbt-fal/1.4.9/ . Please let us know if it does not work for you and reopen this issue.

@chamini2 chamini2 closed this as completed Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants