-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dry run fails when table/view/assertion to be created does not exists #1805
Labels
Comments
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 |
mkamysz
added a commit
to mkamysz/dataform
that referenced
this issue
Jan 21, 2025
1. only set metadata when dryRun is false 2. add marker to row count query part of an assertion. check for marker in create query job and don't execute query if dryRun is true
Hey @Ekrekr, I opened another PR to resolve this issue, seeing that the original fix has been reverted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are two possible errors relating to dry run:
Tables / views
setMetadata
on an view/table that does not exist yet. Relevant lines of codedataform/cli/api/commands/run.ts
Line 371 in 54dfa9c
dataform/cli/api/dbadapters/bigquery.ts
Lines 235 to 239 in 54dfa9c
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
dataform/cli/api/dbadapters/execution_sql.ts
Line 177 in 54dfa9c
Minimal example to reproduce
To recreate this error for view/assertion type, the type can be replaced by either of the two
dataform run --dry-run --tags="TEST_DRY_RUN"
dataform version:
3.0.2
and also tested by running it from sourceThe text was updated successfully, but these errors were encountered: