bigquery-etl/tests/format_sql
Sean Rose 0530c1dc81
Fix `verify-format-sql` CI check not reporting SQL formatting issues (#4827)
* Verify the format of the original SQL, not the generated SQL.

The generated SQL gets reformatted by `bqetl query render`.

* Format all SQL.

* Quote column names containing Jinja expressions to prevent `bqetl format` causing invalid SQL.

* Adjust indentation of some comments to align with the formatted SQL.

* Refactor final `SELECT` in `telemetry_derived.clients_first_seen_v2` to work better with `bqetl format` SQL formatting.

* Fix trailing line comments breaking inline block formatting.

* Fix leading whitespace before Jinja comments not being preserved.

* Add `schema.yaml` for `firefox_ios_derived.baseline_clients_yearly_v1`.

So the `deploy-changes-to-stage` CI can work for the downstream `firefox_ios.baseline_clients_yearly` view.

* Add `schema.yaml` for `firefox_accounts_derived/fxa_users_services_daily_v1`.

So the `dry-run-sql` CI can work for the downstream `firefox_accounts_derived.fxa_users_services_last_seen_v1` ETL.

* Correct `schema.yaml` and `init.sql` for `firefox_accounts_derived.fxa_users_last_seen_v1`.

So the `dry-run-sql` CI can work for the downstream `firefox_accounts_derived.fxa_users_last_seen_v1` ETL.

* Fully qualify table reference in `init.sql` for `firefox_accounts_derived.fxa_users_last_seen_v1`.

So the table dependency will get detected by the `deploy-changes-to-stage` CI to deploy it so the `dry-run-sql` CI can work for the `init.sql` file.

* Improve `JinjaComment` inheritance and docstring.

* Implement `Line.ends_with_line_comment` property and refactor `inline_block_format()`.
2024-01-22 11:48:08 -08:00
..
capitalize_builtin_functions Change `bqetl format` to uppercase built-in function names (#3536) 2023-01-26 16:07:10 -08:00
capitalize_keywords Format transaction statements properly (#3892) 2023-06-02 16:36:11 +00:00
case_statements Change `bqetl format` to improve readability of `CASE` statements (#3546) 2023-02-03 14:35:59 -08:00
jinja_example Fix `verify-format-sql` CI check not reporting SQL formatting issues (#4827) 2024-01-22 11:48:08 -08:00
scripting_example Indent join conditions (#4223) 2024-01-11 15:50:26 -08:00
conftest.py Upgrade to pytest 6.0.1 (#1281) 2020-09-02 11:30:14 -07:00