dataform-co / dataform-web-tracking

Dataform is a collaborative data modelling platform that enables analysts and engineers to manage complex data models in SQL
https://dataform.co
MIT License
2 stars 0 forks source link

Referencing a UDF would require an input in unit tests for the same function #321

Open mshakhomirov opened 2 years ago

mshakhomirov commented 2 years ago

I believe the issue here is that the same dataset rules are being applied to UDF when you reference it with ${ref()}. Example view:

select 
        target_id
        , product
        , product_type_id
        , ${ref("update_purchase_summary")}( ARRAY_AGG(STRUCT(some columns) ) -- It's a UDF being applied to array. Can't use ref() here otherwise unit tests won't work.
        -- , production.update_purchase_summary( ARRAY_AGG(STRUCT(some columns) )