fal-ai / dbt-fal

do more with dbt. dbt-fal helps you run Python alongside dbt, so you can send Slack alerts, detect anomalies and build machine learning models.
https://fal.ai/dbt-fal
Apache License 2.0
853 stars 72 forks source link

fix(dbt-fal): handle new relation quoting for Python introduced in dbt-1.4.5 #781

Closed chamini2 closed 1 year ago

chamini2 commented 1 year ago

Description

We are seeing

Error: 00:24:01.472113 [error] [MainThread]: Table “freshness_table” not found

This was introduced in https://github.com/dbt-labs/dbt-core/issues/7114

def source(*args, dbt_load_df_function):
    sources = {"freshness_test.freshness_table": "test.dbt_fal_custom.freshness_table"}
    key = ".".join(args)
    return dbt_load_df_function(sources[key])

vs

def source(*args, dbt_load_df_function):
    sources = {"freshness_test.freshness_table": "\"test\".\"dbt_fal_custom\".\"freshness_table\""}
    key = '.'.join(args)
    return dbt_load_df_function(sources[key])

Notice the quotes in the sources dict.

Integration tests

Adapter to test: