You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by zjffdu <gi...@git.apache.org> on 2017/04/21 05:24:19 UTC

[GitHub] zeppelin pull request #2272: ZEPPELIN-2397. Add toJson and fromJson method f...

GitHub user zjffdu opened a pull request:

    https://github.com/apache/zeppelin/pull/2272

    ZEPPELIN-2397. Add toJson and fromJson method for serializable objects

    ### What is this PR for?
    Add toJson and fromJson method for all the objects that need ser/der in zeppelin. 
    
    
    ### What type of PR is it?
    [Refactoring]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-2397?filter=-2
    
    ### How should this be tested?
    Outline the steps to test the PR here.
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zjffdu/zeppelin ZEPPELIN-2397

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2272.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2272
    
----
commit 043868602c9e9a092c385b946ec49eb3ecd6b4ca
Author: Jeff Zhang <zj...@apache.org>
Date:   2017-04-12T10:43:34Z

    ZEPPELIN-2397. Add toJson and fromJson method for serializable objects

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    this seems like a good change. perhaps toJSON etc should be in a common base class to avoid duplications?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2272: ZEPPELIN-2397. Add toJson and fromJson method f...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/zeppelin/pull/2272


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    @felixcheung @Leemoonsoo  Any more comments on this ? This PR also address the issue in ZEPPELIN-2652. 
    
    Failed test is flaky test. I will address it in #2422
    
    ```
    Failed tests: 
      ZeppelinSparkClusterTest.pySparkTest:291 expected:<ERROR> but was:<FINISHED>
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    I saw it above. It doesn't reduce the code size but I think it will help another contributors understand code well. How do you think of it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    I am fine to add interface for it. But only `JsonSerializable` can be added, because `fromJson` is static method.  It is some kind of code convention, should be easy to read and understand. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    @jongyoul Thanks for the review. Copy my comment above. 
    ```
    toJson and fromJson is used in both zeppelin-interpreter and zeppelin-zengine. I didn't find a proper place to put the common interface. And actually the interface doesn't eliminate the code duplication, the sub classes still need to implement toJson as not every classes share the same Gson (some class need custom Gson). So I didn't add a common interface. 
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    LGTM. For the next step, how about introducing `JsonSerializable` and `JsonDeserializable` as interfaces?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    Thanks @felixcheung @jongyoul for the review. Comments are addressed. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    @felixcheung toJson and fromJson is used in both zeppelin-interpreter and zeppelin-zengine. I didn't find a proper place to put the common interface. And actually the interface doesn't not eliminate the code, the sub classes still need to implement `toJson` as not every classes share the same Gson (some class need custom Gson). So I didn't add a common interface. Please help review it. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    Thanks @jongyoul  Will merge it if no more discussion


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2272: ZEPPELIN-2397. Add toJson and fromJson method for seri...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2272
  
    @jongyoul @felixcheung Comments are address, please help review. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---