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

Add unit tests for struct Converter #7884

Closed
wants to merge 1 commit into from

Conversation

gggrace14
Copy link
Contributor

Add unit tests for struct Converter and Conversions.h. struct Converter
holds the core logic for casting between scalar types. Source of the test
cases are CastExprTest.cpp and
https://facebookincubator.github.io/velox/functions/presto/conversion.html

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 5, 2023
Copy link

netlify bot commented Dec 5, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit cd408cd
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/65729869d209700008842870

@facebook-github-bot
Copy link
Contributor

@gggrace14 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@gggrace14 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@kagamiori kagamiori left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for adding the test coverage! The failed CircleCI signal should have been fixed. Please rebase to ensure the test passes.

Comment on lines 397 to 400
testConversion<float, int64_t>(
{kInf}, {}, /*truncate*/ false, false, /*expectError*/ true);
testConversion<float, int64_t>(
{kNan}, {0}, /*truncate*/ false, false, /*expectError*/ true);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can these two be combined into one testConversion call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revised

Comment on lines 409 to 411
testConversion<float, int64_t>(
{kInf}, {9223372036854775807}, /*truncate*/ true);
testConversion<float, int64_t>({kNan}, {0}, /*truncate*/ true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

Add unit tests for struct Converter and Conversions.h.
struct Converter holds the core logic for casting between scalar
types. Source of the test cases are CastExprTest.cpp and
https://facebookincubator.github.io/velox/functions/presto/conversion.html
@facebook-github-bot
Copy link
Contributor

@gggrace14 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@gggrace14
Copy link
Contributor Author

Thank you, @kagamiori Wei, for the quick review!

@facebook-github-bot
Copy link
Contributor

@gggrace14 merged this pull request in 7249cd9.

@gggrace14 gggrace14 deleted the conversiontests branch December 8, 2023 06:20
Copy link

Conbench analyzed the 1 benchmark run on commit 7249cd9b.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants