Skip to content

feat: add is_null support in testfile parser#120

Merged
scgkiran merged 4 commits intosubstrait-io:mainfrom
scgkiran:parser-changes
Feb 28, 2025
Merged

feat: add is_null support in testfile parser#120
scgkiran merged 4 commits intosubstrait-io:mainfrom
scgkiran:parser-changes

Conversation

@scgkiran
Copy link
Copy Markdown
Contributor

@scgkiran scgkiran commented Feb 24, 2025

Add nullable parameter to literal creation utils
Literal creation helpers now include an additional boolean parameter for nullability.

Add nullable parameter to literal creation utils
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 96.85535% with 5 lines in your changes missing coverage. Please review.

Project coverage is 63.90%. Comparing base (e64c786) to head (593a090).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
literal/utils.go 94.59% 4 Missing ⚠️
expr/literals.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
+ Coverage   63.79%   63.90%   +0.11%     
==========================================
  Files          44       44              
  Lines       10917    10921       +4     
==========================================
+ Hits         6964     6979      +15     
+ Misses       3638     3627      -11     
  Partials      315      315              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread expr/literals.go
Comment thread literal/utils.go

func NewBool(value bool) expr.Literal {
return expr.NewPrimitiveLiteral[bool](value, false)
func NewBool(value bool, nullable bool) expr.Literal {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These changes while straightforward are going to break a lot of existing code. Two alternates would be to add an additional function with the new behavior (NewNullBool creating a nullable Bool or NewNullableBool with the option similar to what is implemented here). A third is to actually make this a breaking change which would cause a version bump. A fourth option would be to add a new method to expr.Literal that would change the nullability to be set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will mark this as breaking change

@scgkiran scgkiran merged commit b0cb727 into substrait-io:main Feb 28, 2025
@scgkiran scgkiran deleted the parser-changes branch February 28, 2025 05:14
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.

2 participants