[ZEPPELIN-6457] Extract shared Python ZeppelinContext helpers for PySpark and PyFlink #5405
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 380 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5405"
general
weight: 0.35
ParkGyeongTae
What is this PR for?
PySpark and PyFlink currently define their
ZeppelinContextsubclasses separately in the classic Python and IPython bootstrap resources, even though the implementations are effectively the same for each backend.This PR moves the PySpark and PyFlink implementations into the shared
zeppelin_context.pyresource and reuses them from both bootstrap paths.Backend-specific behavior remains unchanged:
PySpark handles Spark
DataFrameobjects through_jdf.PyFlink handles Flink
Tableobjects through_j_table.PyFlink retains support for the
stream_typeargument.Other object types fall back to
PyZeppelinContext.show().IPySparkZeppelinContextandIPyFlinkZeppelinContextremain available as compatibility aliases.No new dependencies are introduced.
What type of PR is it?
Refactoring
Todos
[x] Move the PySpark ZeppelinContext implementation to the shared resource
[x] Move the PyFlink ZeppelinContext implementation to the shared resource
[x] Reuse the shared implementations from Python and IPython bootstraps
[x] Keep the existing IPython class names as compatibility aliases
[x] Verify Spark and Flink interpreter packaging
[x] Verify PySpark
z.show(DataFrame)behaviorWhat is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6457
How should this be tested?
The following checks passed successfully:
Result: 1 test passed.
Results:
PySparkInterpreterTest#testPySparkpassed.Existing ScalaTest suite: 18 tests passed.
z.show(DataFrame)was exercised successfully.Result: 12-module reactor build succeeded.
Result: 13-module reactor build succeeded.
The generated Spark and Flink interpreter JARs were also verified to contain the shared context resource and the corresponding classic and IPython bootstrap resources.
git diff --checkalso passes.Screenshots (if appropriate)
Not applicable. This PR does not change the user interface.
Questions
Do the license files need to be updated? No.
Are there breaking changes for older versions? No. The existing IPython context names remain available as compatibility aliases.