dataform-co / dataform

Dataform is a framework for managing SQL based data operations in BigQuery
https://cloud.google.com/dataform/docs
Apache License 2.0
854 stars 166 forks source link

fix(1805): dry run fails when table/view/assertion already does not exists #1806

Closed ashish10alex closed 2 months ago

ashish10alex commented 3 months ago

Solves https://github.com/dataform-co/dataform/issues/1805

  1. Tables/views: For a view / table the metadata need not be set when doing a dry run only query validation is sufficient as metadata cannot be set if the object is not yet being materialised in BigQuery
  2. Assertions: No need to do select sum(1) ... on the view that will be created by the assertion. The query validation is sufficient to establish if the query that will be created is valid.

Tests

  1. Dry run on assertions pass if the query is correct
  2. Dry run on assertion correctly fails if the query is not valid
  3. Dry run on table/view passes if the query is valid
  4. Dry run on table/view correctly fails if the query is not valid
  5. bazel test //core/... passes