Fix ipython pin breaking Google Colab; update deprecated guardian_check API#93
Draft
planetf1 wants to merge 5 commits into
Draft
Conversation
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>
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.
** Still working on this - validating on colab/local. Not ready **
Problem
Two bugs in the
hello_melleatutorial notebook:1.
ipython>=8.10.0breaks Google ColabThe
[tutorials]extra pinnedipython>=8.10.0, which upgrades Colab's tightly-pinnedipython==7.34.0to 9.x. This breaks thegoogle-colabpackage, destabilises the runtime, and causes a forced kernel restart with conflicts againstgradioandgoogle-adk.2. Deprecated
target_roleparameter inguardian_checkcallshello_mellea.ipynbcallsguardian_check(..., target_role="user"), which was deprecated in mellea PR #1037 (merged 2026-05-18, landed inmellea==0.6.0— the version pinned by this project). Every run producesDeprecationWarningnoise and will break when the parameter is removed.Fix
pyproject.toml: Relaxipython>=8.10.0→ipython>=7.0. Colab's7.34.0satisfies the floor so pip leaves it untouched; a fresh local environment still gets ipython installed for theIPython.displayimports used ingranite_switch.tutorials.tutorials/notebooks/hello_mellea.ipynb: Replacetarget_role="user"withscoring_schema="user_prompt"in bothguardian_checkcalls (direct equivalent per mellea's_TARGET_ROLE_TO_SCHEMAmapping). Also clears saved cell outputs — notebooks committed clean.Testing
hello_mellea.ipynbverified end-to-end in Google Colab (T4) against branch installrag_101.ipynb— to be tested in Colab and standalonerag_flow.ipynb— to be tested in Colab and standaloneThe ipython fix applies to all three
[tutorials]notebooks; onlyhello_melleahas theguardian_checkdeprecation.