Skip to content

chore: Remove SDK and Python processor modules#591

Open
StefanoFioravanzo wants to merge 6 commits intokubeflow:mainfrom
StefanoFioravanzo:cleanup/remove-sdk-pyprocessor
Open

chore: Remove SDK and Python processor modules#591
StefanoFioravanzo wants to merge 6 commits intokubeflow:mainfrom
StefanoFioravanzo:cleanup/remove-sdk-pyprocessor

Conversation

@StefanoFioravanzo
Copy link
Member

Summary

  • Remove the SDK module (@pipeline, @step decorators)
  • Remove Python processor (alternative to notebook processing)
  • Remove BaseProcessor abstract class and inline into NotebookProcessor
  • Simplify compiler to notebook-only workflow

Changes

  • Deleted: examples/sdk/ directory (29 files)
  • Deleted: backend/kale/sdk/ module
  • Deleted: backend/kale/processors/pyprocessor.py
  • Deleted: backend/kale/processors/baseprocessor.py
  • Deleted: backend/kale/templates/py_function_template.jinja2
  • Updated: backend/kale/processors/__init__.py - Remove PythonProcessor export
  • Updated: backend/kale/__init__.py - Remove SDK imports
  • Refactored: backend/kale/processors/nbprocessor.py - Inline BaseProcessor logic
  • Simplified: backend/kale/compiler.py - Remove processor type branching

Context

The SDK and Python processor were experimental features that added complexity without significant adoption. For 2.0, we're focusing on the core notebook-to-pipeline workflow.

With PythonProcessor removed, the BaseProcessor abstract class was no longer needed - its logic (run(), _post_pipeline(), _configure_poddefaults(), _apply_steps_defaults()) has been inlined directly into NotebookProcessor.

This is a breaking change appropriate for a major version bump.

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from stefanofioravanzo. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot requested a review from ederign February 4, 2026 08:20
@StefanoFioravanzo StefanoFioravanzo force-pushed the cleanup/remove-sdk-pyprocessor branch from 4494ad8 to a33e86d Compare February 4, 2026 12:33
Remove the entire examples/sdk/ directory which contained examples
for the Python decorator-based SDK workflow:

- skeleton.py: Basic SDK usage tutorial
- retry-pipeline.py: Retry configuration example
- artifact.py: Artifact handling example
- compression-pipeline.py: (already removed in Phase 1)
- titanic/: ML classification example
- quantile-regression/: Regression example
- README.md: SDK documentation

Kale 2.0 focuses exclusively on the notebook-based workflow.
The SDK/decorator approach is being removed as part of the
modernization effort.

BREAKING CHANGE: SDK examples are no longer available.

Signed-off-by: Stefano Fioravanzo <stefano.fioravanzo@gmail.com>
Remove the backend/kale/sdk/ module which provided Python decorator-based
pipeline definition:

- api.py: @pipeline, @step, and @artifact decorators
- __init__.py: Module exports

The SDK enabled writing pipelines using Python decorators instead of
Jupyter notebooks. This workflow is being removed in Kale 2.0 to focus
exclusively on the notebook-based approach.

BREAKING CHANGE: The kale.sdk module is no longer available.
Users should migrate to the notebook-based workflow.

Signed-off-by: Stefano Fioravanzo <stefano.fioravanzo@gmail.com>
Remove the PythonProcessor and its associated template:

- processors/pyprocessor.py: Processor that converted decorated Python
  functions into Pipeline objects
- templates/py_function_template.jinja2: Jinja2 template for generating
  KFP components from Python functions

The PythonProcessor enabled the SDK workflow where users could define
pipelines using @pipeline and @step decorators. This is being removed
in Kale 2.0 to focus exclusively on the notebook-based workflow.

BREAKING CHANGE: PythonProcessor is no longer available.

Signed-off-by: Stefano Fioravanzo <stefano.fioravanzo@gmail.com>
Update import statements to remove PythonProcessor references:

- processors/__init__.py: Remove PythonProcessor import
- kale/__init__.py: Remove PythonProcessor from imports

The package now only exports NotebookProcessor for pipeline creation.

Signed-off-by: Stefano Fioravanzo <stefano.fioravanzo@gmail.com>
Remove Python processor template selection logic from the compiler:

- Remove PY_FN_TEMPLATE constant (py_function_template.jinja2)
- Remove PIPELINE_ORIGIN dictionary that mapped processor.id to templates
- Remove conditional check for processor.id == "nb"
- Always use NB_FN_TEMPLATE for component generation

The compiler now exclusively supports notebook-based pipeline generation,
simplifying the code and removing the unused Python processor code path.

Signed-off-by: Stefano Fioravanzo <stefano.fioravanzo@gmail.com>
With PythonProcessor removed, the BaseProcessor abstract class is no
longer needed. Inline its logic directly into NotebookProcessor:
- run() method
- _post_pipeline() method
- _configure_poddefaults() method
- _apply_steps_defaults() method

Signed-off-by: Stefano Fioravanzo <stefano.fioravanzo@gmail.com>
@StefanoFioravanzo StefanoFioravanzo force-pushed the cleanup/remove-sdk-pyprocessor branch from a33e86d to 1bfd7bc Compare February 4, 2026 20:29
@FAUST-BENCHOU
Copy link

backend/kale/processors/nbprocessor.py:231:32
_pod_defaults_labels = dict() should be _pod_defaults_labels = {}

backend/kale/processors/nbprocessor.py:237
self.pipeline.config.steps_defaults.get("labels", dict()) should be self.pipeline.config.steps_defaults.get("labels", {})

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.

2 participants