You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/06/14 08:01:37 UTC

[GitHub] [zeppelin] zjffdu opened a new pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

zjffdu opened a new pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135


   ### What is this PR for?
   
   Simple PR to address NPE on empty dynamic form input. Instead of throwing NPE, just make the form value as empty string. 
   
   ### What type of PR is it?
   [Improvement]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/ZEPPELIN-5290
   
   ### How should this be tested?
   * CI pass
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135#discussion_r652425047



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/display/Input.java
##########
@@ -373,7 +373,11 @@ public static String getSimpleQuery(Map<String, Object> params, String script, b
         }
       } else {
         // single-selection
-        expanded = value.toString();
+        if (value == null) {

Review comment:
       [StringUtils.defaultString](http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/StringUtils.html#defaultString%28java.lang.String%29) looks more elegant.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

Posted by GitBox <gi...@apache.org>.
Reamer commented on pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135#issuecomment-862130900


   LGTM


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] asfgit closed pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] zjffdu commented on pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

Posted by GitBox <gi...@apache.org>.
zjffdu commented on pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135#issuecomment-862112387


   Will merge if no more comment


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] Reamer commented on a change in pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135#discussion_r652425047



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/display/Input.java
##########
@@ -373,7 +373,11 @@ public static String getSimpleQuery(Map<String, Object> params, String script, b
         }
       } else {
         // single-selection
-        expanded = value.toString();
+        if (value == null) {

Review comment:
       [StringUtils.defaultString](http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/StringUtils.html#defaultString(java.lang.String,%20java.lang.String)) looks more elegant.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zeppelin] zjffdu commented on a change in pull request #4135: [ZEPPELIN-5290] NPE on empty dynamic form input

Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #4135:
URL: https://github.com/apache/zeppelin/pull/4135#discussion_r652428776



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/display/Input.java
##########
@@ -373,7 +373,11 @@ public static String getSimpleQuery(Map<String, Object> params, String script, b
         }
       } else {
         // single-selection
-        expanded = value.toString();
+        if (value == null) {

Review comment:
       Thanks for the review @Reamer  I have updated it 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org