EDIT: This was downstream of other issues, like adding the HasOutput to my functions SQLX file. This $ref code is fine
In my Dataform repo I define a function BusinessDays_ufn.sqlx, which is an Operations file for a SQL UDF called by another view in the sam repo, Metrics_uvw.sqlx. It calls it like:
${ref(dataform.projectConfig.vars.TARGET_PROJECT, dataform.projectConfig.vars.TARGET_SCHEMA, "BusinessDays_ufn")}
This gives the following error:
Compilation errors:
definitions\outputs\Loan\Metrics_uvw.sqlx: Error: Actions cannot resolve operations which do not produce output.
at t.Session.resolve (C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:17:87750)
at p.resolve (C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:15:317171)
at p.ref (C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:15:317037)
at Object.sqlContextable (C:\Users\...\source\repos\dataform-prp-1\definitions\outputs\Loan\Metrics_uvw.sqlx:73:13)
at C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:17:86749
at p.apply (C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:15:317893)
at u.compile (C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:15:315771)
at C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:17:91987
at Array.forEach (<anonymous>)
at t.Session.compileGraphChunk (C:\Users\...\source\repos\dataform-prp-1\node_modules\@dataform\core\bundle.js:17:91961)
However, this works fine when I create the function separately and then call it directly, e.g. with schema.Business_Days_ufn(). Is this intended behavior?