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: Improve comments in EnforceDistribution tests #8474

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 8, 2023

Which issue does this PR close?

related to #8451

Rationale for this change

While working on a reproducer for #8451 I noticed several things that could be improved in the EnforceDistribution tests

What changes are included in this PR?

  1. Add comments
  2. Update parameter names to match config names
  3. Fix typos

Are these changes tested?

Covered by existing tests

Are there any user-facing changes?

No. It is a code cleanup only

@github-actions github-actions bot added the core Core DataFusion crate label Dec 8, 2023
@@ -928,7 +928,7 @@ fn add_roundrobin_on_top(
// If any of the following conditions is true
// - Preserving ordering is not helpful in terms of satisfying ordering requirements
// - Usage of order preserving variants is not desirable
// (determined by flag `config.optimizer.bounded_order_preserving_variants`)
// (determined by flag `config.optimizer.prefer_existing_sort`)
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 config option was renamed to prefer_existing_sort but some of the comments and variable names refer to the old name

@@ -2056,23 +2056,33 @@ pub(crate) mod tests {
}

/// Runs the repartition optimizer and asserts the plan against the expected
/// Arguments
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 it very hard to read some of the tests as a line like this

        assert_optimized!(expected, physical_plan, false, true);

As I had to go back to the macro definitions several times to remember what the false and true parameters meant

@alamb alamb marked this pull request as ready for review December 8, 2023 21:51
@alamb alamb requested a review from mustafasrepo December 11, 2023 14:18
Copy link
Contributor

@mustafasrepo mustafasrepo left a comment

Choose a reason for hiding this comment

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

Thanks @alamb. This Pr is LGTM!.

@alamb alamb merged commit 1861c3d into main Dec 11, 2023
43 checks passed
appletreeisyellow pushed a commit to appletreeisyellow/datafusion that referenced this pull request Dec 15, 2023
appletreeisyellow pushed a commit to appletreeisyellow/datafusion that referenced this pull request Jan 3, 2024
appletreeisyellow pushed a commit to appletreeisyellow/datafusion that referenced this pull request Jan 3, 2024
@alamb alamb deleted the alamb/test_cleanup branch January 17, 2024 14:24
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