How do I call a silver layer DLT table in my DBT project

Hello,
I need to create a Gold dbt table from a DLT silver table.
I tried all variation on the source parameter, I cannot find anything that works.
I get the error:
(models/gold/client.sql) depends on a source named ‘silver-dlt-meta.customers’ which was not found
Thanks for any help you can provide, Pierre

My schema.yml is:

version: 2

sources:
  - name: dltmetasilver
    schema: silver-dlt-meta
    catalog: prcatalog
    tables:
      - name: customers

models:
  - name: Client
    description: "Merged data from clients and accounts tables"
    columns:
      - name: ClientId
        description: "Identifiant unique du client"
        tests:
          - not_null
      - name: Nom
        description: "Nom de famille du client"
        tests:
          - not_null
      - name: Adresse
        description: "Adresse du client"
        tests:
          - not_null
      - name: Courriel
        description: "Numéro de téléphone du client"
        tests:
          - not_null
      - name: DateNaissance
        description: "Date de naissance du client"
        tests:
          - not_null

My Client.sql is:

WITH client AS (
    SELECT
        ClientId,
        Prenom,
        Nom,
        Adresse,
        Courriel,
        DateNaissance,
        NAS
    FROM
       {{ source('silver-dlt-meta','customers')  }}
)
SELECT
    ClientId,
    Nom,
    Adresse,
    Courriel,
    DateNaissance
FROM
    client

My dbt_project.yml is:

config-version: 2
version: '0.1'
name: 'DbtGoldMeta'
profile: 'databricks'

model-paths: ["models"]
macro-paths: ["macros"]

require-dbt-version: [">=1.0.0", "<2.0.0"]

models:
  DbtGoldMeta:
    +materialized: 'table'
    gold:
      +schema: 'dbt-gold'
      +materialized: 'view'

Hi @Pierre
You should use source name as first argument in source function.
Correct syntax: {{ source('dltmetasilver','customers') }}

Thanks a a lot. I did not occur to me to set the source instead of the schema. Pierre

Hi, if my answer resolves your issue, could you please mark it as the solution? It might help others facing similar problems.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.