You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "liuxiaocs7 (via GitHub)" <gi...@apache.org> on 2023/03/15 17:31:32 UTC
[GitHub] [iceberg] liuxiaocs7 opened a new pull request, #7116: Aliyun: Remove AssertHelpers
liuxiaocs7 opened a new pull request, #7116:
URL: https://github.com/apache/iceberg/pull/7116
- SubTask of #7094
Remove AssertHelpers in `iceberg-aliyun` module
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] nastra commented on a diff in pull request #7116: Aliyun: Remove AssertHelpers
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#discussion_r1139921246
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSInputStream.java:
##########
@@ -99,14 +99,10 @@ public void testClose() throws Exception {
OSSURI uri = new OSSURI(location("closed.dat"));
SeekableInputStream closed = new OSSInputStream(ossClient().get(), uri);
closed.close();
- assertThrows(
- "Cannot seek the input stream after closed.",
- IllegalStateException.class,
- "Cannot seek: already closed",
- () -> {
- closed.seek(0);
- return null;
- });
+ Assertions.assertThatThrownBy(
+ () -> closed.seek(0), "Cannot seek the input stream after closed.")
Review Comment:
```suggestion
() -> closed.seek(0))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] liuxiaocs7 commented on a diff in pull request #7116: Aliyun: Remove AssertHelpers
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#discussion_r1139934349
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSInputStream.java:
##########
@@ -99,14 +99,10 @@ public void testClose() throws Exception {
OSSURI uri = new OSSURI(location("closed.dat"));
SeekableInputStream closed = new OSSInputStream(ossClient().get(), uri);
closed.close();
- assertThrows(
- "Cannot seek the input stream after closed.",
- IllegalStateException.class,
- "Cannot seek: already closed",
- () -> {
- closed.seek(0);
- return null;
- });
+ Assertions.assertThatThrownBy(
+ () -> closed.seek(0), "Cannot seek the input stream after closed.")
Review Comment:
thx, fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] jackye1995 merged pull request #7116: Aliyun: Remove AssertHelpers
Posted by "jackye1995 (via GitHub)" <gi...@apache.org>.
jackye1995 merged PR #7116:
URL: https://github.com/apache/iceberg/pull/7116
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] liuxiaocs7 commented on pull request #7116: Aliyun: Remove AssertHelpers
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#issuecomment-1470465376
@nastra This is the beginning of issue-#7094, I am not quite sure that the requirements are met, please review it for me when you have time, thx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Aliyun: Remove AssertHelpers [iceberg]
Posted by "amshali (via GitHub)" <gi...@apache.org>.
amshali commented on PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#issuecomment-1745985095
I am working on `iceberg-flink` module.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] nastra commented on a diff in pull request #7116: Aliyun: Remove AssertHelpers
Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#discussion_r1138252705
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSOutputFile.java:
##########
@@ -63,11 +63,11 @@ public void testWriteFile() throws IOException {
@Test
public void testFromLocation() {
- AssertHelpers.assertThrows(
- "Should catch null location when creating oss output file",
- NullPointerException.class,
- "location cannot be null",
- () -> OSSOutputFile.fromLocation(ossClient, null, aliyunProperties));
+ Assertions.assertThatThrownBy(
+ () -> OSSOutputFile.fromLocation(ossClient, null, aliyunProperties),
+ "Should catch null location when creating oss output file")
Review Comment:
same here regarding the description part. I don't think it adds any value keeping it
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSInputFile.java:
##########
@@ -61,13 +61,13 @@ public void testReadFile() throws Exception {
@Test
public void testOSSInputFile() {
OSSURI uri = randomURI();
- AssertHelpers.assertThrows(
- "File length should not be negative",
- ValidationException.class,
- "Invalid file length",
- () ->
- new OSSInputFile(
- ossClient().get(), uri, aliyunProperties, -1, MetricsContext.nullMetrics()));
+ Assertions.assertThatThrownBy(
+ () ->
+ new OSSInputFile(
+ ossClient().get(), uri, aliyunProperties, -1, MetricsContext.nullMetrics()),
+ "File length should not be negative")
Review Comment:
nit: I would probably remove the description `File length should not be negative` from here as it doesn't add any value. However in other places in the codebase the description might be useful.
Going forward it would be good to double-check if having the description makes sense
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSURI.java:
##########
@@ -49,47 +49,46 @@ public void testEncodedString() {
@Test
public void invalidBucket() {
Review Comment:
we can omit the description in all of the changes in this class
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSURI.java:
##########
@@ -49,47 +49,46 @@ public void testEncodedString() {
@Test
public void invalidBucket() {
- AssertHelpers.assertThrows(
- "Invalid bucket",
- IllegalArgumentException.class,
- OSS_RESOURCE_MANAGER.getFormattedString("BucketNameInvalid", "test_bucket"),
- () -> new OSSURI("https://test_bucket/path/to/file"));
+
+ Assertions.assertThatThrownBy(
+ () -> new OSSURI("https://test_bucket/path/to/file"), "Invalid bucket")
Review Comment:
same as above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] liuxiaocs7 commented on a diff in pull request #7116: Aliyun: Remove AssertHelpers
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#discussion_r1139860718
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSURI.java:
##########
@@ -49,47 +49,46 @@ public void testEncodedString() {
@Test
public void invalidBucket() {
Review Comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] liuxiaocs7 commented on pull request #7116: Aliyun: Remove AssertHelpers
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#issuecomment-1476327462
Hi, @jackye1995 The CI has passed, PTAL.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] liuxiaocs7 commented on a diff in pull request #7116: Aliyun: Remove AssertHelpers
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#discussion_r1139844635
##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/TestOSSInputFile.java:
##########
@@ -61,13 +61,13 @@ public void testReadFile() throws Exception {
@Test
public void testOSSInputFile() {
OSSURI uri = randomURI();
- AssertHelpers.assertThrows(
- "File length should not be negative",
- ValidationException.class,
- "Invalid file length",
- () ->
- new OSSInputFile(
- ossClient().get(), uri, aliyunProperties, -1, MetricsContext.nullMetrics()));
+ Assertions.assertThatThrownBy(
+ () ->
+ new OSSInputFile(
+ ossClient().get(), uri, aliyunProperties, -1, MetricsContext.nullMetrics()),
+ "File length should not be negative")
Review Comment:
> nit: I would probably remove the description `File length should not be negative` from here as it doesn't add any value. However in other places in the codebase the description might be useful. Going forward it would be good to double-check if having the description makes sense
Thank you for your comments, I will check it before modifying.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] liuxiaocs7 commented on pull request #7116: Aliyun: Remove AssertHelpers
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#issuecomment-1473285746
@nastra Please take a look again when you are free, thx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] jackye1995 commented on pull request #7116: Aliyun: Remove AssertHelpers
Posted by "jackye1995 (via GitHub)" <gi...@apache.org>.
jackye1995 commented on PR #7116:
URL: https://github.com/apache/iceberg/pull/7116#issuecomment-1476709812
Given this is just method deprecation, I will go ahead to merge it instead of waiting for more approvals, thanks @liuxiaocs7 and thanks @nastra for the review!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org