-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Migrate dataframe tests to insta
#15262
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
Conversation
Thank you! FYI to fix fmt, you can Lines 22 to 23 in 87eec43
|
async fn get_batches(expr: Expr, limit: usize) -> Result<Vec<RecordBatch>> { | ||
let df = create_test_table().await?; | ||
let df = df.select(vec![expr])?.limit(0, Some(limit))?; | ||
df.collect().await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fully replicate the original logic, you can also do get_batches(expr)
and get_batches_with_limit(expr, limit)
- that way you're reduce the magic number (10) across the codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes good point, I've updated the code with your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏🙏🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which issue does this PR close?
Closes #15245.
Rationale for this change
What changes are included in this PR?
Migrated tests in
datafusion/core/tests/dataframe
to use insta.Are these changes tested?
Are there any user-facing changes?
No.