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
851 stars 163 forks source link

dataform format: if-based columns are indented at the same level as the "select" clause #1864

Open kevin-zhou-dev opened 4 weeks ago

kevin-zhou-dev commented 4 weeks ago

dataform --version returns 3.0.2

Initial sqlx file:

config {
  type: "view",
  schema: "my_schema"
}

SELECT
  id,
  IF( duration >= 120, TRUE, FALSE ) AS flag_a
FROM
  TABLE

After executing dataform format:

config {
  type: "view",
  schema: "my_schema"
}

SELECT
  id,
IF
  ( duration >= 120, TRUE, FALSE ) AS flag_a
FROM
  TABLE

Expected:

config {
  type: "view",
  schema: "my_schema"
}

SELECT
  id,
  IF( duration >= 120, TRUE, FALSE ) AS flag_a
FROM
  TABLE