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

Return Comm rather than BaseComm from create_comm #1091

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

matthewturk
Copy link

This replaces BaseComm in create_comm with Comm, which should match what is expected by ipywidgets for validation of the comm trait in subclasses of ipywidgets.Widget.

Fixes #1090 .

@blink1073 blink1073 added the bug label Feb 8, 2023
@matthewturk
Copy link
Author

It looks like the failure is in ipyparallel with:

______________________ AsyncResultTest.test_wait_for_send ______________________
  
  self = <ipyparallel.tests.test_asyncresult.AsyncResultTest testMethod=test_wait_for_send>
  
      def test_wait_for_send(self):
          view = self.client[-1]
          view.track = True
  >       with self.assertRaises(TimeoutError):
  E       AssertionError: TimeoutError not raised
  
  ipyparallel/tests/test_asyncresult.py:377: AssertionError

My intuition doesn't have much to say about if this is related.

@blink1073
Copy link
Contributor

It seems to be an intermittent failure. I saw it in #1089, but then it passed on the merge commit. I just kicked it.

@@ -45,7 +45,7 @@

def _create_comm(*args, **kwargs):
"""Create a new Comm."""
return BaseComm(*args, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I misunderstood what you intended to change. We wanted to explicitly return BaseComm here because it is more efficient. I think the right answer is for ipywidgets to relax its expected trait.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, BaseComm is 'the new thing', Comm is for backwards compatibility with ipywidgets.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, but since ipywidgets doesn't accept BaseComm should that be the submitted change? I guess I'm confused because @blink1073's suggestion seemed straightforward, but now I don't understand how to interpret @maartenbreddels's reply.

@blink1073
Copy link
Contributor

cc @maartenbreddels @martinRenou

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

Successfully merging this pull request may close these issues.

ipywidgets expects Comm, not BaseComm
3 participants