Skip to content

Fix type inference for LIKE and other Predicate nodes#2051

Merged
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:fix-type-inf
Apr 24, 2026
Merged

Fix type inference for LIKE and other Predicate nodes#2051
shangyian merged 2 commits intoDataJunction:mainfrom
shangyian:fix-type-inf

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

Summary

Predicate nodes (LIKE, NOT LIKE, RLIKE, IN, BETWEEN, IS NULL) had no case in _resolve_expr_type, so they fell through to a generic fallback that invoked expr.type without stamping _type on child nodes first. This ends up raising an AttributeError, gets swallowed, and silently leaks UnknownType upward. The result is that any bare col LIKE pattern (and any AND-chain built on top) resolved to UnknownType and tripped "Unable to infer type for column X" even when the expression was trivially boolean.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit ed56d2d
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69eb2e6578fe9f00086a3a14

@shangyian shangyian added the bug Something isn't working label Apr 24, 2026
@shangyian shangyian marked this pull request as ready for review April 24, 2026 09:11
@shangyian shangyian merged commit 83b13f8 into DataJunction:main Apr 24, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant