Skip to content

Fix ipython pin breaking Google Colab; update deprecated guardian_check API#93

Draft
planetf1 wants to merge 5 commits into
generative-computing:mainfrom
planetf1:bugfix/tutorials-ipython-colab-conflict
Draft

Fix ipython pin breaking Google Colab; update deprecated guardian_check API#93
planetf1 wants to merge 5 commits into
generative-computing:mainfrom
planetf1:bugfix/tutorials-ipython-colab-conflict

Conversation

@planetf1

@planetf1 planetf1 commented Jun 11, 2026

Copy link
Copy Markdown

** Still working on this - validating on colab/local. Not ready **

Problem

Two bugs in the hello_mellea tutorial notebook:

1. ipython>=8.10.0 breaks Google Colab

The [tutorials] extra pinned ipython>=8.10.0, which upgrades Colab's tightly-pinned ipython==7.34.0 to 9.x. This breaks the google-colab package, destabilises the runtime, and causes a forced kernel restart with conflicts against gradio and google-adk.

2. Deprecated target_role parameter in guardian_check calls

hello_mellea.ipynb calls guardian_check(..., target_role="user"), which was deprecated in mellea PR #1037 (merged 2026-05-18, landed in mellea==0.6.0 — the version pinned by this project). Every run produces DeprecationWarning noise and will break when the parameter is removed.

Fix

pyproject.toml: Relax ipython>=8.10.0ipython>=7.0. Colab's 7.34.0 satisfies the floor so pip leaves it untouched; a fresh local environment still gets ipython installed for the IPython.display imports used in granite_switch.tutorials.

tutorials/notebooks/hello_mellea.ipynb: Replace target_role="user" with scoring_schema="user_prompt" in both guardian_check calls (direct equivalent per mellea's _TARGET_ROLE_TO_SCHEMA mapping). Also clears saved cell outputs — notebooks committed clean.

Testing

  • hello_mellea.ipynb verified end-to-end in Google Colab (T4) against branch install
  • rag_101.ipynb — to be tested in Colab and standalone
  • rag_flow.ipynb — to be tested in Colab and standalone
  • Standalone local run (all three notebooks)

The ipython fix applies to all three [tutorials] notebooks; only hello_mellea has the guardian_check deprecation.

planetf1 added 5 commits June 11, 2026 14:50
ipython>=8.10.0 upgraded Colab's tightly-pinned ipython==7.34.0 to 9.x,
breaking the google-colab package and destabilising the runtime. Changed
to ipython>=7.0 — Colab's 7.34.0 satisfies the floor so pip leaves it
untouched, while a fresh local environment still gets ipython installed.

Affects notebooks using [tutorials]: hello_mellea, rag_101, rag_flow.

Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
mellea PR #1037 (merged 2026-05-18, landed in mellea==0.6.0) deprecated
target_role in favour of scoring_schema. The two guardian_check calls in
the Guardian section were passing target_role="user"; update both to
scoring_schema="user_prompt" (the direct equivalent per mellea's
_TARGET_ROLE_TO_SCHEMA mapping).

Also clears saved cell outputs — notebooks should be committed clean.

Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
… conflict

Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
…h conflict

Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
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