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/06/20 12:17:03 UTC

[GitHub] [iceberg] liuxiaocs7 opened a new pull request, #7868: Core: Remove deprecated AssertHelpers

liuxiaocs7 opened a new pull request, #7868:
URL: https://github.com/apache/iceberg/pull/7868

   - SubTask of https://github.com/apache/iceberg/issues/7094
   Remove `AssertHelpers` in `iceberg-core` 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 #7868: Core: Remove deprecated AssertHelpers

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #7868:
URL: https://github.com/apache/iceberg/pull/7868#discussion_r1235313321


##########
core/src/test/java/org/apache/iceberg/TestManifestReaderStats.java:
##########
@@ -275,9 +275,6 @@ private void assertStatsDropped(DataFile dataFile) {
 
   private void assertNullRecordCount(DataFile dataFile) {
     // record count is a primitive type, accessing null record count will throw NPE
-    AssertHelpers.assertThrows(
-        "Should throw NPE when accessing non-populated record count field",
-        NullPointerException.class,
-        dataFile::recordCount);
+    Assertions.assertThatThrownBy(dataFile::recordCount).isInstanceOf(NullPointerException.class);

Review Comment:
   can we add a `hasMessage(...)` check here please?



-- 
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 #7868: Core: Remove deprecated AssertHelpers

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7868:
URL: https://github.com/apache/iceberg/pull/7868#discussion_r1236213601


##########
core/src/test/java/org/apache/iceberg/TestManifestReaderStats.java:
##########
@@ -275,9 +275,6 @@ private void assertStatsDropped(DataFile dataFile) {
 
   private void assertNullRecordCount(DataFile dataFile) {
     // record count is a primitive type, accessing null record count will throw NPE
-    AssertHelpers.assertThrows(
-        "Should throw NPE when accessing non-populated record count field",
-        NullPointerException.class,
-        dataFile::recordCount);
+    Assertions.assertThatThrownBy(dataFile::recordCount).isInstanceOf(NullPointerException.class);

Review Comment:
   Thanks for the comment. but there seems no any error message in this case. 



-- 
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 #7868: Core: Remove deprecated AssertHelpers

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #7868:
URL: https://github.com/apache/iceberg/pull/7868#discussion_r1236463414


##########
core/src/test/java/org/apache/iceberg/TestManifestReaderStats.java:
##########
@@ -275,9 +275,6 @@ private void assertStatsDropped(DataFile dataFile) {
 
   private void assertNullRecordCount(DataFile dataFile) {
     // record count is a primitive type, accessing null record count will throw NPE
-    AssertHelpers.assertThrows(
-        "Should throw NPE when accessing non-populated record count field",
-        NullPointerException.class,
-        dataFile::recordCount);
+    Assertions.assertThatThrownBy(dataFile::recordCount).isInstanceOf(NullPointerException.class);

Review Comment:
   it seems that newer JDK versions actually provide an informative error msg to indicate where the NPE happened. In this case let's omit the `.hasMessage()` part



-- 
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 #7868: Core: Remove deprecated AssertHelpers

Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on code in PR #7868:
URL: https://github.com/apache/iceberg/pull/7868#discussion_r1236434702


##########
core/src/test/java/org/apache/iceberg/TestManifestReaderStats.java:
##########
@@ -275,9 +275,6 @@ private void assertStatsDropped(DataFile dataFile) {
 
   private void assertNullRecordCount(DataFile dataFile) {
     // record count is a primitive type, accessing null record count will throw NPE
-    AssertHelpers.assertThrows(
-        "Should throw NPE when accessing non-populated record count field",
-        NullPointerException.class,
-        dataFile::recordCount);
+    Assertions.assertThatThrownBy(dataFile::recordCount).isInstanceOf(NullPointerException.class);

Review Comment:
   yep, i use `.hasMessage(null)` in https://github.com/apache/iceberg/pull/7868/commits/ed4c890a4f6225d94f898a2260ba3712706eb821, it works in my local env, but fails in this action https://github.com/apache/iceberg/actions/runs/5322419639/jobs/9638844493
   
   ![image](https://github.com/apache/iceberg/assets/42756849/5d885674-1637-45f1-b3b6-3f9ec10210b6)
   
   any suggestions? thanks!



-- 
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 #7868: Core: Remove deprecated AssertHelpers

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #7868:
URL: https://github.com/apache/iceberg/pull/7868#discussion_r1236428962


##########
core/src/test/java/org/apache/iceberg/TestManifestReaderStats.java:
##########
@@ -275,9 +275,6 @@ private void assertStatsDropped(DataFile dataFile) {
 
   private void assertNullRecordCount(DataFile dataFile) {
     // record count is a primitive type, accessing null record count will throw NPE
-    AssertHelpers.assertThrows(
-        "Should throw NPE when accessing non-populated record count field",
-        NullPointerException.class,
-        dataFile::recordCount);
+    Assertions.assertThatThrownBy(dataFile::recordCount).isInstanceOf(NullPointerException.class);

Review Comment:
   then let's add `.hasMessage(null)` to indicate that



-- 
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 merged pull request #7868: Core: Remove deprecated AssertHelpers

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra merged PR #7868:
URL: https://github.com/apache/iceberg/pull/7868


-- 
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