GitHub user tae-jun opened a pull request:
https://github.com/apache/zeppelin/pull/2317
[ZEPPELIN-2493] Visualization class should throw an error if an abstract
method is not implemented
### What is this PR for?
`Visualization` class should throw an error if an abstract method is not
implemented just like
[`SpellBase`](https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/app/spell/spell-base.js#L25)
does.
And I added some comments. In my opinion, though `Visualization` has [a
good
example](http://zeppelin.apache.org/docs/0.8.0-SNAPSHOT/development/writingzeppelinvisualization.html),
it needs an API documentation page (`Spell` as well). `Visualization` class
has methods which can be overridden (e.g. `refresh`, `destroy`, etc.), but the
example doesn't mention them. Therefore, users don't know what and how to
implement easily!
### What type of PR is it?
Improvement
### What is the Jira issue?
[ZEPPELIN-2493](https://issues.apache.org/jira/browse/ZEPPELIN-2493)
### How should this be tested?
* Inherit `Visualization`
* Don't implement any abstract method
* Run `getTransformation()` and `render()`
* Check they print appropriate errors
### 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/tae-jun/zeppelin viz-abstract-error
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/2317.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 #2317
----
commit d994b8a8f24301168ab7ce4743b1746258a3e5c1
Author: Jun Kim <[email protected]>
Date: 2017-04-25T10:06:48Z
Throw error if an abstract method is not implemented
commit 3fec6d36ca8d015e4e26c4d554d2a08aa21c5f2f
Author: Jun Kim <[email protected]>
Date: 2017-05-04T05:34:21Z
Throw error if Visualization class is not implemented and make doc more
concrete
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---