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

API: Remove deprecated AssertHelpers usage #7468

Merged
merged 7 commits into from
May 3, 2023

Conversation

akshayakp97
Copy link
Contributor

@akshayakp97 akshayakp97 commented Apr 28, 2023

Summary

@nastra
Copy link
Contributor

nastra commented May 1, 2023

@akshayakp97 thanks for looking into this. It seems there's an overlap with #7482, so you might want to sync up with @liuxiaocs7.
Also we generally try to open one PR per iceberg module to make refactoring and reviewing easier for everyone.

@akshayakp97
Copy link
Contributor Author

@nastra thanks for looking at my PR! I will update my PR to exclude the overlapping files from orc and mr-hive modules.

@nastra nastra changed the title Deprecate AssertHelpers - iceberg-orc, mr and api modules API: Remove deprecated AssertHelpers usage May 2, 2023
api/src/test/java/org/apache/iceberg/TestSnapshotRef.java Outdated Show resolved Hide resolved
() -> Iterables.getLast(concat5));

Assertions.assertThatThrownBy(() -> Iterables.getLast(concat5))
.isInstanceOf(NoSuchElementException.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

would be good to check for the specific error msg here

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 the review. I don't see any error message in this case.
Refer - https://github.com/google/guava/blob/master/guava/src/com/google/common/collect/Iterables.java#L849

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok, thanks for checking. Alternatively we could use .hasMessage(null) to indicate that there's no message I guess

Assertions.assertThatThrownBy(
() -> PartitionSpec.builderFor(SCHEMA).year("ts").year("ts").build())
.hasMessageContaining("Cannot use partition name more than once")
.isInstanceOf(IllegalArgumentException.class);
Copy link
Contributor

@nastra nastra May 3, 2023

Choose a reason for hiding this comment

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

nit: in other places typically the .hasMessage.. part comes after .isInstanceOf(), so we should probably make this consistent here as well

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.

just one minor comment around consistency, but other than that, this LGTM. @jackye1995 do you have any further comments?

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

looks good to me!

@jackye1995 jackye1995 merged commit 3db4e89 into apache:master May 3, 2023
42 checks passed
manisin pushed a commit to Snowflake-Labs/iceberg that referenced this pull request May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants