Skip to content

Fix #620: Use only_semantic=True in NewSemanticExceptionTest#621

Merged
javihern98 merged 1 commit intomainfrom
cr-620
Mar 23, 2026
Merged

Fix #620: Use only_semantic=True in NewSemanticExceptionTest#621
javihern98 merged 1 commit intomainfrom
cr-620

Conversation

@javihern98
Copy link
Copy Markdown
Contributor

What changed

  • NewSemanticExceptionTest now runs with only_semantic=True for semantic errors (codes not starting with "2"), ensuring semantic checks are validated without relying on data execution side-effects
  • Removed deprecated SemanticExceptionTest method (only 2 commented-out call sites remained)
  • Fixed visit_VarID join component ambiguity resolution that was gated behind a data is not None check, preventing it from running in semantic-only mode
  • Fixed visit_HRBinOp WHEN handler to gracefully handle filter_comp.data is None in semantic-only mode
  • Updated test_Fail_GL_67 expected error from 1-1-1-10 to 1-1-6-10 (the correct semantic error)

Why

Several semantic error tests were passing for the wrong reason — data-dependent checks in evaluate() methods would fire before the actual semantic validation, masking the real errors. Running with only_semantic=True exposes the true semantic analysis path and ensures error codes are accurate.

Impact/Risk

Low risk. The interpreter logic changes are minimal (reordering existing checks, adding a null guard). The test helper change affects all NewSemanticExceptionTest callers but all 4057 tests pass.

Notes

This PR is a prerequisite for the DuckDB test routing branch (cr-route-all-tests-through-run), which depends on these fixes.

Closes #620

- Add only_semantic=not is_runtime_error to NewSemanticExceptionTest so
  semantic errors (codes not starting with "2") are validated without
  data execution
- Remove deprecated SemanticExceptionTest (no active call sites)
- Fix visit_VarID: move join ambiguity resolution outside data guard
- Fix visit_HRBinOp: handle filter_comp.data is None in semantic mode
- Update test_Fail_GL_67 expected error to 1-1-6-10

Closes #620
@javihern98 javihern98 requested a review from mla2001 March 23, 2026 08:11
@javihern98 javihern98 marked this pull request as ready for review March 23, 2026 08:12
@javihern98 javihern98 requested a review from a team March 23, 2026 08:12
Copy link
Copy Markdown
Contributor

@mla2001 mla2001 left a comment

Choose a reason for hiding this comment

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

NewSemanticException Test now looks way simpler 😊

@javihern98 javihern98 merged commit e210811 into main Mar 23, 2026
20 checks passed
@javihern98 javihern98 deleted the cr-620 branch March 23, 2026 09:11
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.

Use only_semantic=True in NewSemanticExceptionTest for semantic errors

2 participants