Open ashish10alex opened 3 months ago
Hi, I'm dataform user.
I’m also encountering the same issue, so I wanted to check if there have been any updates on this.
Agreed, we shouldn't be attempting to set metadata on a dry run!
Any chance you can submit a patch yourself? https://github.com/dataform-co/dataform/blob/main/contributing.md
There are two possible errors relating to dry run:
Tables / views
setMetadata
on an view/table that does not exist yet. Relevant lines of codehttps://github.com/dataform-co/dataform/blob/54dfa9ce51b141124608f0b5e15fa01f714e093a/cli/api/commands/run.ts#L371
https://github.com/dataform-co/dataform/blob/54dfa9ce51b141124608f0b5e15fa01f714e093a/cli/api/dbadapters/bigquery.ts#L235-L239
In these lines metadata for the table/view that already does not exist will be undefined and trying to access
.schema
attribute of undefined results in the error shown belowAssertion
Assertion dry run will face if the table it is trying to create does not already exists. Possibly due to trying to run the following query in the current code base which tries to select from a object that does not exist yet
https://github.com/dataform-co/dataform/blob/54dfa9ce51b141124608f0b5e15fa01f714e093a/cli/api/dbadapters/execution_sql.ts#L177
Minimal example to reproduce
SELECT 1 AS A UNION ALL SELECT 1 AS B
dataform version:
3.0.2
and also tested by running it from source