Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ValueString() to all literal types #102

Merged
merged 13 commits into from
Jan 15, 2025

Conversation

EpsilonPrime
Copy link
Member

@EpsilonPrime EpsilonPrime commented Jan 9, 2025

Adds the functionality QueryString() functionality requested in #100 .

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 51.88679% with 51 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@8c4fdcb). Learn more about missing BASE report.
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
types/types.go 0.00% 47 Missing ⚠️
expr/literals.go 92.30% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #102   +/-   ##
=======================================
  Coverage        ?   62.94%           
=======================================
  Files           ?       44           
  Lines           ?    10265           
  Branches        ?        0           
=======================================
  Hits            ?     6461           
  Misses          ?     3519           
  Partials        ?      285           

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

@EpsilonPrime EpsilonPrime force-pushed the literal_revamp branch 2 times, most recently from 6a61c57 to 966a5dc Compare January 9, 2025 19:42
@EpsilonPrime EpsilonPrime requested a review from zeroshade January 9, 2025 19:43
expr/literals.go Outdated Show resolved Hide resolved
expr/literals.go Outdated Show resolved Hide resolved
expr/literals.go Outdated Show resolved Hide resolved
@EpsilonPrime EpsilonPrime changed the title feat: add QueryString() to all literal types feat: add ValueString() to all literal types Jan 9, 2025
expr/literals.go Outdated Show resolved Hide resolved
expr/literals.go Outdated Show resolved Hide resolved
Copy link
Contributor

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

Overall looks great to me, just a couple nit-picks

}
return fmt.Sprintf("[%s]", strings.Join(items, ", "))
}
return fmt.Sprintf("%v", t.Value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a test that hits this so the codecov warning goes away?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, not done. Turns out that map literals go through a different path. I'm not sure how to get it to visit this line.

Comment on lines +1565 to +1567
date := civil.Date{Year: 1970, Month: time.January, Day: 1}
date = date.AddDays(int(d))
return date.String()
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the benefit to this over just using time like we were doing before?

Copy link
Member Author

Choose a reason for hiding this comment

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

Adding days to time.t can be messed up by daylight savings time. Civil date's base type is days so it isn't affected.

@EpsilonPrime EpsilonPrime merged commit 78fdc19 into substrait-io:main Jan 15, 2025
8 checks passed
@EpsilonPrime EpsilonPrime deleted the literal_revamp branch January 15, 2025 22:29
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