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

Minor: Consolidate UDF tests #7704

Merged
merged 6 commits into from
Oct 3, 2023
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Sep 29, 2023

Which issue does this PR close?

Rationale for this change

When evaluating coverage of our user defined functions (UDFs) I found that some tests were in sql_integration, and some were in other places.

What changes are included in this PR?

Consolidate them all into the aptly named user_defined_integration so they are easier to find.

Are these changes tested?

all tests

Are there any user-facing changes?

@github-actions github-actions bot added the core Core DataFusion crate label Sep 29, 2023
let actual = execute(&ctx, sql).await;
let expected = vec![vec!["0.6584408483418833"]];
assert_float_eq(&expected, &actual);
let actual = plan_and_collect(&ctx, sql).await.unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was using a (very) old style to execute

@@ -2330,87 +2330,6 @@ mod tests {
Ok(())
}

#[tokio::test]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to user defined tests

@@ -886,18 +886,6 @@ async fn csv_query_nullif_divide_by_0() -> Result<()> {
Ok(())
}

#[tokio::test]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was randomly in the file for testing exprs when it is actually an (user defined) aggregate query 😕

@@ -101,54 +96,6 @@ pub mod select;
mod sql_api;
pub mod subqueries;
pub mod timestamp;
pub mod udf;

fn assert_float_eq<T>(expected: &[Vec<T>], received: &[Vec<String>])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not needed

@alamb alamb marked this pull request as ready for review September 29, 2023 20:24
@alamb
Copy link
Contributor Author

alamb commented Oct 3, 2023

Thanks @yjshen !

@alamb alamb merged commit 32fe176 into apache:main Oct 3, 2023
22 checks passed
Ted-Jiang pushed a commit to Ted-Jiang/arrow-datafusion that referenced this pull request Oct 7, 2023
* Minor: Consolidate user defined functions

* cleanup

* move more tests

* more

* cleanup use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants