I have a source file definitions/source/tiktok/advertiser.sqlx
with the following declaration:
config {
type: "declaration",
schema: "tiktok_ads",
name: "advertiser",
description: "All advertising accounts from Tiktok"
}
I am trying to define a table with javascript using the below:
publish("tiktok2", {
schema: "sample_schema",
type: "table",
dependencies: (["tiktok_ads.advertiser"]),
description: "table description"
}).query(ctx => `
SELECT
advertiser.name AS campaign_advertiser
FROM
tiktok_ads.advertiser advertiser
`)
However the dependendencies
propery is generating an error (Missing dependency detected: Action "the-brand-usa.sample_schema.tiktok" depends on "{"name":"tiktok_ads.advertiser","includeDependentAssertions":false}" which does not exist
).
I know the table exists and the source file is declared properly because if I replace the query to use ref() then METADATA displays the dependency properly and the whole workspace compiles properly without errors.
SELECT
advertiser.name AS campaign_advertiser
FROM
${ctx.ref("tiktok_ads", "advertiser")} advertiser