Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ebyhr
Copy link
Contributor

@ebyhr ebyhr commented Jul 21, 2025

No description provided.


assertThat(cache.size()).isEqualTo(1);
assertThat(cache).containsExactlyEntriesOf(Map.of(1, 1));
assertThat(cache).hasSize(1).containsExactlyEntriesOf(Map.of(1, 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assertThat(cache).hasSize(1).containsExactlyEntriesOf(Map.of(1, 1));
assertThat(cache).hasSize(1).containsEntry(1, 1);


assertThat(cache.size()).isEqualTo(2);
assertThat(cache).containsExactly(Map.entry(1, 1), Map.entry(3, 3));
assertThat(cache).hasSize(2).containsExactly(Map.entry(1, 1), Map.entry(3, 3));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assertThat(cache).hasSize(2).containsExactly(Map.entry(1, 1), Map.entry(3, 3));
assertThat(cache).hasSize(2).containsEntry(1, 1).containsEntry(3, 3);

double maxDriftPercentage) {

assertThat(partitionResults.size()).isEqualTo(expectedAssignmentInfo.size());
assertThat(partitionResults).hasSize(expectedAssignmentInfo.size());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assertThat(partitionResults).hasSize(expectedAssignmentInfo.size());
assertThat(partitionResults).hasSameSizeAs(expectedAssignmentInfo);

FlinkParquetReaders.buildReader(new Schema(SUPPORTED_PRIMITIVES.fields()), fileSchema);

assertThat(reader.columns().size()).isEqualTo(SUPPORTED_PRIMITIVES.fields().size());
assertThat(reader.columns()).hasSize(SUPPORTED_PRIMITIVES.fields().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assertThat(reader.columns()).hasSize(SUPPORTED_PRIMITIVES.fields().size());
assertThat(reader.columns()).hasSameSizeAs(SUPPORTED_PRIMITIVES.fields());


assertThat(cache.size()).isEqualTo(1);
assertThat(cache).containsExactlyEntriesOf(Map.of(1, 1));
assertThat(cache).hasSize(1).containsExactlyEntriesOf(Map.of(1, 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above


// verify that the dataframe matches
assertThat(rows.size()).isEqualTo(records.size());
assertThat(rows).hasSize(records.size());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assertThat(rows).hasSize(records.size());
assertThat(rows).hasSameSizeAs(records);

the advantage here is that this will also show the content of actual/expected when the assertion ever fails

Copy link
Contributor

Choose a reason for hiding this comment

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

can you also please update all the other places that are affected in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your suggestion. Addressed comments.

Copy link
Contributor

@nastra nastra 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 for cleaning this up @ebyhr

@nastra nastra merged commit 13871b2 into apache:main Jul 23, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants