You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "move-hoon (via GitHub)" <gi...@apache.org> on 2026/08/09 08:56:55 UTC

[PR] [ZEPPELIN-6457] Extract shared Python ZeppelinContext helpers for PySpark and PyFlink [zeppelin]

move-hoon opened a new pull request, #5404:
URL: https://github.com/apache/zeppelin/pull/5404

   ### What is this PR for?
   
   PySpark and PyFlink currently define their `ZeppelinContext` subclasses 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.py` resource and reuses them from both bootstrap paths.
   
   Backend-specific behavior remains unchanged:
   
   * PySpark handles Spark `DataFrame` objects through `_jdf`.
   * PyFlink handles Flink `Table` objects through `_j_table`.
   * PyFlink retains support for the `stream_type` argument.
   * Other object types fall back to `PyZeppelinContext.show()`.
   * `IPySparkZeppelinContext` and `IPyFlinkZeppelinContext` remain 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)` behavior
   
   ### What is the Jira issue?
   
   https://issues.apache.org/jira/browse/ZEPPELIN-6457
   
   ### How should this be tested?
   
   The following checks passed successfully:
   
   ```bash
   ./mvnw test \
     -pl python \
     -Dtest=PythonInterpreterTest#testBackendZeppelinContextsAvailable \
     -DfailIfNoTests=false \
     -Dmaven.gitcommitid.skip=true
   ```
   
   Result: 1 test passed.
   
   ```bash
   PYSPARK_PYTHON="$(command -v python3.12)" \
   PYSPARK_DRIVER_PYTHON="$(command -v python3.12)" \
   ./mvnw test \
     -pl spark/interpreter \
     --am \
     -Pspark-3.5 \
     -Pspark-scala-2.12 \
     -Dtest=PySparkInterpreterTest#testPySpark \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -Dmaven.gitcommitid.skip=true
   ```
   
   Results:
   
   * `PySparkInterpreterTest#testPySpark` passed.
   * Existing ScalaTest suite: 18 tests passed.
   * `z.show(DataFrame)` was exercised successfully.
   
   ```bash
   ./mvnw package \
     -pl spark/interpreter \
     --am \
     -Pspark-3.5 \
     -Pspark-scala-2.12 \
     -DskipTests \
     -Dmaven.gitcommitid.skip=true
   ```
   
   Result: 12-module reactor build succeeded.
   
   ```bash
   ./mvnw package \
     -pl flink/flink-scala-2.12 \
     --am \
     -Pflink-1.20 \
     -DskipTests \
     -Dmaven.gitcommitid.skip=true
   ```
   
   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 --check` also 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.
   * Does this need documentation? No. There are no user-facing behavior or configuration changes.
   


-- 
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: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-6457] Extract shared Python ZeppelinContext helpers for PySpark and PyFlink [zeppelin]

Posted by "move-hoon (via GitHub)" <gi...@apache.org>.
move-hoon closed pull request #5404: [ZEPPELIN-6457] Extract shared Python ZeppelinContext helpers for PySpark and PyFlink
URL: https://github.com/apache/zeppelin/pull/5404


-- 
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: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org