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: Add DataFrame test #8341

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Minor: Add DataFrame test #8341

merged 3 commits into from
Nov 29, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 28, 2023

Which issue does this PR close?

Part of #8194

Rationale for this change

Follow on to #8316 I noticed that one of the test was actually using the dataframe API, so it should also be put in the dataframe tests

What changes are included in this PR?

Restore one tests into the dataframe tests

Are these changes tested?

They are all tests

Are there any user-facing changes?

@alamb alamb marked this pull request as ready for review November 28, 2023 12:54
@github-actions github-actions bot added the core Core DataFusion crate label Nov 28, 2023
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @alamb

assert_eq!("c1", physical_plan.schema().field(0).name().as_str());
assert_eq!(
"total_salary",
physical_plan.schema().field(1).name().as_str()
Copy link
Member

Choose a reason for hiding this comment

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

Actually this test doesn't really use DataFrame API but creates logical plan and physical plan with SessionState. Maybe physical-plan? But there doesn't have tests module, so here is also good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right -- I mistakenly assumed that the scan_empty was returning a DataFrame (it is actually returning a LogicalPlanBuilder): https://github.com/alamb/arrow-datafusion/blob/9a15bf89682728a277cc0a8f443fbd4ba8398ae6/datafusion/core/src/test_util/mod.rs#L133

I will see if I can find a better home for this

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 in 2ea11a0

@@ -2540,6 +2540,27 @@ mod tests {
Ok(())
}

#[tokio::test]
async fn aggregate_with_alias() -> Result<()> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found a better place for this test (with the other tests that are checking things about the physical plans)

Copy link
Member

Choose a reason for hiding this comment

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

Looks good. 👍

@alamb alamb merged commit d22403a into apache:main Nov 29, 2023
22 checks passed
@alamb alamb deleted the alamb/dataframe_test branch November 29, 2023 16:12
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.

3 participants