Try to pass cell id to executing kernel.#886
Merged
blink1073 merged 2 commits intoipython:mainfrom Mar 31, 2022
Merged
Conversation
Contributor
|
I'm addressing the CI failures in #887 |
Contributor
|
Kicking CI |
Carreau
added a commit
to Carreau/ipython
that referenced
this pull request
Mar 22, 2022
Other side of ipython/ipykernel#886 half of ipython#13579
Member
|
I am not sure about this. Wouldn't it be some kind of abstraction leak? |
Member
Author
|
IMHO that ship has sailed, this info is already sent as part of the execute
request from front end to here, and is already used by other kernels. The
goal is also to help having a mapping from execution/limiting to original
cell.
I agree that kernel should be able to work without, but I also don’t see
any reason to prevent it.
…On Wed, Mar 23, 2022 at 10:42 AM Sylvain Corlay ***@***.***> wrote:
I am not sure about this. Wouldn't it be some kind of abstraction leak?
—
Reply to this email directly, view it on GitHub
<#886 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACR5T4EBDQ76OEXPXAMEBTVBLRO3ANCNFSM5RLCS6HA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
|
OK, LGTM. |
Contributor
|
I assume we can't add a test for this until |
Member
Author
I should probably add some test that subclasses/methods that both do and do not support gettign cell_id behave properly. I'll try to do that at least. |
Contributor
Is seem that few kernel want to make use of cell id for various reasons. One way to get the cell_id in the executing context is to make use of init_metadata but it is marked for removal. for example in [there](https://github.com/robots-from-jupyter/robotkernel/blob/19b28267406d1f8555ce73b96e7efb8af8417266/src/robotkernel/kernel.py#L196-L205) Another is to start passing cell_id down. This is technically a change of API as our consumer may not support more parameters so we take a peak at the signature, and pass cell_id only if it is : - an explicit parameter, - the function/method takes varkwargs. We could also start to refactor to pass a metadata object with multiple fields if this is the preferred route. One questions is whether and how we want to deprecated not receiving cell_id as a parameter. Related to ipython/ipython#13579 and subsequent PR on IPython side to support cell_id in progress.
for more information, see https://pre-commit.ci
Member
Author
|
The remaining failure has been fixed downstream in ipyparallel. |
Member
Author
|
Thanks ! |
This was referenced Apr 2, 2022
Carreau
added a commit
to Carreau/ipython
that referenced
this pull request
Apr 5, 2022
Other side of ipython/ipykernel#886 half of ipython#13579
This was referenced Nov 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Is seem that few kernel want to make use of cell id for various
reasons.
One way to get the cell_id in the executing context is to make use of
init_metadata but it is marked for removal.
for example in there
Another is to start passing cell_id down.
This is technically a change of API as our consumer may not support more
parameters so we take a peak at the signature, and pass cell_id only if
it is :
We could also start to refactor to pass a metadata object with multiple
fields if this is the preferred route.
One questions is whether and how we want to deprecated not receiving
cell_id as a parameter.
Related to ipython/ipython#13579 and
subsequent PR on IPython side to support cell_id in progress.