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

use asyncio.isfuture to check plum_future is unwrapped #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Dec 3, 2020

  • The plum_future passed in may wrap a _asyncio.Future which is not
    an instace of plumpy.Future. So asyncio.isfuture is indispensable here to
    continue to unwrap the future to the final result.
  • there is a typo in callback function on_dnoe. The augment is
    _plum_future with an underscore as its prefix while in the callback
    function there is not but use the unlocal plum_future.

As mentioned in aiidateam/aiida-core#4595 (comment), I change it to asyncio.isfuture in aiida_core but forget there also the same issue in plumpy. Although this didn't cause any problem yet, may relate to some subtle problem. Moreover, the typo of _plum_future seems doesn't matter just because we didn't have a deeply wrapped future. It would be more make sense to adopt the modifies in this pull request.

- The `plum_future` passed in may wrap a `_asyncio.Future` which is not
   a instace of `plumpy.Future`. So `asyncio.isfuture` is indisponsible
   here to continue unwrap the future to final result.
- there is a typo in callback function `on_dnoe`. The augment is
  `_plum_future` with an undersore as its prefix while in the callback
  function there is not but use the unlocal `plum_future`.
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

Successfully merging this pull request may close these issues.

1 participant