Dataform core version 3.0.47
This definition will fail when running dataform run --dry-run
config {
"type": "table",
}
SELECT 1 AS foo
pre_operations {
DECLARE bar DATE DEFAULT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY));
-- DECLARE bar DATE DEFAULT DATE_TRUNC(DATE('2026-01-01'), WEEK(MONDAY))
}
Dataset creation failed: test.trailing_comment_test [table]
DECLARE bar DATE DEFAULT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY));
-- DECLARE bar DATE DEFAULT DATE_TRUNC(DATE('2026-01-01'), WEEK(MONDAY))
;
create or replace table projectid.test.trailing_comment_test as
SELECT 1 AS foo
bigquery error: Syntax error: Unexpected ";" at [4:1]
It will also fail with:
DECLARE bar DATE DEFAULT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY))
---
-- DECLARE bar DATE DEFAULT DATE_TRUNC(DATE('2026-01-01'), WEEK(MONDAY))
Dataset creation failed: test.trailing_comment_test [table]
DECLARE bar DATE DEFAULT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY))
;
-- DECLARE bar DATE DEFAULT DATE_TRUNC(DATE('2026-01-01'), WEEK(MONDAY))
;
create or replace table projectid.test.trailing_comment_test as
SELECT 1 AS foo
bigquery error: Syntax error: Unexpected ";" at [4:1]
both forms will work in the GCP dataform service (they'll compile and run).
Moving the comment above the declaration works.
Dataform core version 3.0.47
This definition will fail when running
dataform run --dry-runconfig { "type": "table", } SELECT 1 AS foo pre_operations { DECLARE bar DATE DEFAULT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY)); -- DECLARE bar DATE DEFAULT DATE_TRUNC(DATE('2026-01-01'), WEEK(MONDAY)) }It will also fail with:
both forms will work in the GCP dataform service (they'll compile and run).
Moving the comment above the declaration works.