Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beakerx.showProgressUpdate from Scala #7859

Closed
pschatzmann opened this issue Nov 16, 2018 · 4 comments
Closed

beakerx.showProgressUpdate from Scala #7859

pschatzmann opened this issue Nov 16, 2018 · 4 comments

Comments

@pschatzmann
Copy link

I am not able to call beakerx.showProgressUpdate() from Scala:

  • beakerx.showProgressUpdate("", 1) gives the error: :99: error: the result type of an implicit conversion must be more specific than AnyRef beakerx.showProgressUpdate("", 1)
  • beakerx.showProgressUpdate("", new java.lang.Integer(1)) gives the error: java.lang.NoSuchMethodException: com.twosigma.beakerx.NamespaceClient.showProgressUpdate(java.lang.String, java.lang.Integer)

I think it would help if you change the method definition from public void showProgressUpdate(String message, int progress) to public void showProgressUpdate(String message, Integer progress) in com.twosigma.beakerx.NamespaceClient

@jpallas
Copy link
Contributor

jpallas commented Nov 17, 2018

The beakerx object currently does everything through the dynamic interface, and that's the real problem. A quick workaround would be to use _beakerx. If beakerx should support the BeakerXClient interface, then it needs to implement that interface.

@pschatzmann
Copy link
Author

You are right! In Groovy the beakerx variable is of the class com.twosigma.beakerx.NamespaceClient and this seems to be different in Scala: _beakerx.showProgressUpdate("",50) is working as expected!

Thanks for the clarification...

@jpallas
Copy link
Contributor

jpallas commented Nov 17, 2018

I think it's confusing that the beakerx object in Groovy has both static behavior and dynamic fields, while in Scala some of the static behavior happens to work but some doesn't. I mentioned in an earlier discussion that I don't think the dynamicApply support in the beakerx object is useful.

Either _beakerx should be documented, or beakerx should implement the static behavior. I think the latter would be more consistent with other kernels.

@pschatzmann
Copy link
Author

I think the following approach should work consistently across the different kernels:

var client = NamespaceClient.getBeakerX()
client.showProgressUpdate("", progress )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants