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

Try to pass cell id to executing kernel. #886

Merged
merged 2 commits into from
Mar 31, 2022
Merged

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Mar 22, 2022

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 :

  • 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.

@blink1073
Copy link
Contributor

I'm addressing the CI failures in #887

@blink1073
Copy link
Contributor

Kicking CI

@SylvainCorlay
Copy link
Member

I am not sure about this. Wouldn't it be some kind of abstraction leak?

@Carreau
Copy link
Member Author

Carreau commented Mar 23, 2022 via email

@SylvainCorlay
Copy link
Member

OK, LGTM.

@blink1073
Copy link
Contributor

I assume we can't add a test for this until ipython supports it?

@Carreau
Copy link
Member Author

Carreau commented Mar 25, 2022

I assume we can't add a test for this until ipython supports it?

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.

@blink1073
Copy link
Contributor

@Carreau I think you need to rebase and run black to avoid the merge conflicts. I don't yet quite trust the meeseeks black runner, it didn't seem to work when I tried yesterday

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.
@Carreau
Copy link
Member Author

Carreau commented Mar 31, 2022

The remaining failure has been fixed downstream in ipyparallel.
I think this is good to merge.

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks!

@blink1073 blink1073 merged commit 133e68c into ipython:main Mar 31, 2022
@Carreau
Copy link
Member Author

Carreau commented Mar 31, 2022

Thanks !

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

Successfully merging this pull request may close these issues.

3 participants