Skip to content

Conversation

@buraksenn
Copy link
Contributor

Which issue does this PR close?

Closes #10595

Rationale for this change

These methods are pretty straight forward but they did not have any unit tests. Thus, this PR adds required tests.

What changes are included in this PR?

  • unit tests

Are these changes tested?

  • only change is addition of tests

Are there any user-facing changes?

No

@github-actions github-actions bot added the functions Changes to functions implementation label Jan 26, 2025
@buraksenn
Copy link
Contributor Author

buraksenn commented Jan 26, 2025

The tests pass on my local env but fail in CI not sure why. I'll try to find the root cause and fix it in a few hours

It seems this my local environment was not printing stack trace for error cases and CI does so error matches did not work. I've pushed the fix I expect it to pass now

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks like an improvement to me -- thank you @buraksenn

upper: f64,
input_sort: SortProperties,
expected: Option<SortProperties>,
expect_err: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have the expected error be a string rather than a bool

Something like

Suggested change
expect_err: bool,
expect_err: Option<&'static str>,

That way we can ensure the errors aren't changing unexpectedly

Copy link
Contributor Author

@buraksenn buraksenn Jan 27, 2025

Choose a reason for hiding this comment

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

It was like that before but due to some issues in CI and local difference, I took a shortcut there but probably should not have done that. Let me properly fix it. Thanks for the review

Copy link
Contributor Author

@buraksenn buraksenn Jan 27, 2025

Choose a reason for hiding this comment

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

Oh, I got it now. I needed to strip_backtrace() before comparing errors. I think I've fixed it now

@buraksenn buraksenn force-pushed the add-unit-tests-to-monotonicity branch from a94b02e to 23edd68 Compare January 27, 2025 22:44
Copy link
Contributor

@berkaysynnada berkaysynnada left a comment

Choose a reason for hiding this comment

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

Thanks @buraksenn, LGTM

"Test '{}' failed: got {:?}, expected {:?}",
tcase.name, a, e
),
(Err(e1), Err(e2)) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice 💯

@berkaysynnada berkaysynnada merged commit e3db359 into apache:main Jan 28, 2025
25 checks passed
@berkaysynnada berkaysynnada deleted the add-unit-tests-to-monotonicity branch January 28, 2025 08:24
descending: false,
nulls_first: false,
}),
expected: exec_err!("Input range of LN contains out-of-domain values"),
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand Test Coverage for ScalarUDF's

3 participants