Skip to content

test: add parentheses test cases for formula harness#21816

Merged
joaoviana merged 1 commit intomainfrom
04-07-feat_add_parentheses_formula_tests
Apr 20, 2026
Merged

test: add parentheses test cases for formula harness#21816
joaoviana merged 1 commit intomainfrom
04-07-feat_add_parentheses_formula_tests

Conversation

@joaoviana
Copy link
Copy Markdown
Contributor

@joaoviana joaoviana commented Apr 7, 2026

Closes:

Description:

This PR adds comprehensive test coverage for parentheses handling in formula expressions. The new test suite includes:

  • Literal arithmetic with nested parentheses - Testing basic grouping with pure numeric values including triple-nested redundant parentheses
  • Operator precedence modification - Verifying that parentheses correctly force addition before multiplication and other precedence changes
  • Complex column expressions - Testing deeply nested groupings with database columns and redundant parentheses around single columns
  • Logical operations - Ensuring parentheses work correctly with comparison operators and IF statements
  • Function integration - Testing parentheses that group function results like ABS()
  • Unary operators - Verifying proper handling of unary minus within parenthetical expressions

All test cases are configured to run across DuckDB, Postgres, BigQuery, and Snowflake warehouses with expected results for a 10-row test dataset.

Copy link
Copy Markdown
Contributor Author

joaoviana commented Apr 7, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🧪 Test Selection

✅ Tests that will run

Test Description
Preview Environment Deploys a preview environment for testing

⏭️ Tests skipped (no relevant file changes detected)

Test How to trigger manually
Frontend E2E Tests Add test-frontend to PR description
Backend API Tests Add test-backend to PR description
Timezone Tests Add test-timezone to PR description
CLI Tests Add test-cli to PR description

Tip: Add test-all to your PR description to run all tests.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Your preview environment pr-21816 has been deployed with errors.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Preview Environment

🌐 URL: https://lightdash-preview-pr-21816.lightdash.okteto.dev

📋 Logs: View in GCP Console

🔧 SSH: ./scripts/okteto-ssh.sh 21816

@joaoviana joaoviana force-pushed the 04-07-feat_add_bigquery_formula_test_connection branch from 1a75539 to f7f9537 Compare April 7, 2026 16:59
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from 2feb0cc to bf34763 Compare April 7, 2026 16:59
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from bf34763 to e8ddd70 Compare April 7, 2026 17:21
@joaoviana joaoviana force-pushed the 04-07-feat_add_bigquery_formula_test_connection branch from f7f9537 to 1cfb2f3 Compare April 7, 2026 17:21
@joaoviana joaoviana changed the base branch from 04-07-feat_add_bigquery_formula_test_connection to graphite-base/21816 April 7, 2026 17:26
@joaoviana joaoviana marked this pull request as ready for review April 7, 2026 17:27
@joaoviana joaoviana force-pushed the graphite-base/21816 branch from 1cfb2f3 to 576d15d Compare April 8, 2026 09:09
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from e8ddd70 to 16c6a5b Compare April 8, 2026 09:09
@graphite-app graphite-app Bot changed the base branch from graphite-base/21816 to main April 8, 2026 09:09
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from 16c6a5b to a2a7f67 Compare April 8, 2026 09:10
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from a2a7f67 to 35a9f99 Compare April 20, 2026 13:55
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from 35a9f99 to 96e0fe7 Compare April 20, 2026 18:15
Add 9 test cases covering parentheses handling:
- Pure literal arithmetic: =(5 * (1 + 3)), =(((1 + 2))), =((2 + 3) * (4 - 1)) / 3
- Precedence override: =A * (B + C)
- Deep nesting: =((A + B) * (A - C)) / 2
- Redundant parens: =((A))
- Logical grouping: =IF((A > 100) AND (B < 20), "yes", "no")
- Function results: =(ABS(A) + ABS(B)) * 2
- Unary minus: =(-A) * (B + C)

All 9 cases target ALL_WAREHOUSES to match the convention used by
every other case file — verified passing on DuckDB (307/307) and
Redshift (307/307).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joaoviana joaoviana force-pushed the 04-07-feat_add_parentheses_formula_tests branch from 96e0fe7 to f2ce493 Compare April 20, 2026 18:18
@joaoviana joaoviana merged commit 83c6785 into main Apr 20, 2026
10 of 11 checks passed
@joaoviana joaoviana deleted the 04-07-feat_add_parentheses_formula_tests branch April 20, 2026 18:23
@lightdash-bot
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 0.2769.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants