akshaychitneni commented on code in PR #34840: URL: https://github.com/apache/airflow/pull/34840#discussion_r1385347118
########## airflow/providers/papermill/operators/papermill.py: ########## @@ -17,17 +17,102 @@ # under the License. from __future__ import annotations +from functools import cached_property from typing import TYPE_CHECKING, ClassVar, Collection, Sequence import attr +from papermill.utils import remove_args, merge_kwargs +from pydantic import typing + import papermill as pm +from papermill.engines import NBClientEngine +from papermill.clientwrap import PapermillNotebookClient +from jupyter_client.manager import AsyncKernelManager +from jupyter_client.client import KernelClient +from traitlets import Unicode from airflow.lineage.entities import File from airflow.models import BaseOperator +from airflow.providers.papermill.hooks.kernel import KernelHook if TYPE_CHECKING: from airflow.utils.context import Context +REMOTE_KERNEL_ENGINE = "remote_kernel_engine" + + +class RemoteKernelManager(AsyncKernelManager): + """ + Jupyter kernel manager that connects to a remote kernel. + """ + session_key = Unicode('', config=True, help="Session key to connect to remote kernel") + + @property + def has_kernel(self) -> bool: + return True + + async def _async_is_alive(self) -> bool: + return True + + def shutdown_kernel(self, now: bool = False, restart: bool = False) -> None: + pass Review Comment: The operator is not managing the lifecycle of the kernel but only connecting to a remote kernel if configured via hook -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org