Skip to content

Fix #1805: failing dry-runs when table/view/assertion do not exist#1893

Merged
Ceridan merged 4 commits intodataform-co:mainfrom
mkamysz:fix-1805-failing-dry-runs
Feb 28, 2025
Merged

Fix #1805: failing dry-runs when table/view/assertion do not exist#1893
Ceridan merged 4 commits intodataform-co:mainfrom
mkamysz:fix-1805-failing-dry-runs

Conversation

@mkamysz
Copy link
Copy Markdown
Contributor

@mkamysz mkamysz commented Jan 21, 2025

Fixes #1805, as former fix in #1806 has been reverted in #1834.

  • Only attempt to set metadata for tables if BigQuery option dryRun is false
  • Assertions consist of two separate queries, first creating a view and second selecting from the view, expecting an empty result set; the second part of this process needs to be skipped for dry runs, as the view does not actually get created

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
@mkamysz mkamysz requested a review from a team as a code owner January 21, 2025 13:43
@mkamysz mkamysz requested review from zaptot and removed request for a team January 21, 2025 13:43
@mkamysz mkamysz changed the title Fix #1805 Fix #1805: failing dry-runs when table/view/assertion do not exist Jan 24, 2025
@Ceridan Ceridan requested review from Ekrekr and removed request for zaptot February 14, 2025 14:23
@Ekrekr
Copy link
Copy Markdown
Contributor

Ekrekr commented Feb 17, 2025

Thanks for the patch!

@Ceridan
Copy link
Copy Markdown
Contributor

Ceridan commented Feb 26, 2025

@mkamysz friendly ping, and thank you for the patch!

@mkamysz
Copy link
Copy Markdown
Contributor Author

mkamysz commented Feb 26, 2025

Hey @Ekrekr @Ceridan, thanks for reviewing and giving pointers! Should be clearer now

@Ceridan Ceridan requested a review from Ekrekr February 26, 2025 12:52
Copy link
Copy Markdown
Contributor

@Ekrekr Ekrekr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Very clean now

@Ceridan
Copy link
Copy Markdown
Contributor

Ceridan commented Feb 28, 2025

@mkamysz, could you please merge the latest main branch to your branch? I believe it should fix presubmit test failures.

@Ceridan Ceridan enabled auto-merge (squash) February 28, 2025 13:51
@Ceridan Ceridan self-requested a review February 28, 2025 13:51
@Ceridan Ceridan merged commit d86df1a into dataform-co:main Feb 28, 2025
2 checks passed
@mkamysz mkamysz deleted the fix-1805-failing-dry-runs branch February 28, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dry run fails when table/view/assertion to be created does not exists

3 participants