Hi Team. When I run this model, it complains that there is a circular dependency. sate_tender_customer is a downstream incremental table model. What is the best pattern to implement this in dbt?
select
tender
, customer_id
, sysdate() as start_date
, '9999-12-31'::DATE as end_date
from {{ ref('tender_customer') }}
union
select
customer_id
, start_date
, sysdate() as end_date
from {{ ref('sate_tender_customer')}} as sate
where not exists (
select 1
from {{ ref('tender_customer') }} as tender_customer
where
tender_customer.hash_acct = sate.hash_acct and
tender_customer.customer_id = sate.customer_id
)