-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
332 improve spark integration (#333)
* Refactor demo notebook structure by converting a code cell to markdown for improved documentation. Removed redundant markdown cell and updated execution metadata for clarity. This enhances the user experience by providing better context and organization within the notebook. * Refactor Spark session creation in notebook and JavaScript model - Renamed `create_spark_dev` to `create_spark` in `startup.py` to simplify the function name. - Made `create_spark` available in IPython's global namespace for easier access. - Removed the default Spark instance creation to allow for manual session management. - Updated `SparkModel.js` to use the new `create_spark` function for initializing Spark sessions, enhancing integration with the backend API. * Enhance Spark session creation and configuration handling - Updated `create_spark` function in `startup.py` to accept an optional `notebook_path` parameter, allowing for dynamic configuration retrieval based on the notebook context. - Improved error handling in `create_spark` to log errors and use default Spark configuration when the API request fails. - Modified `SparkModel.js` to pass the `notebookPath` to the `create_spark` function, ensuring proper session initialization. - Cleaned up the demo notebook by removing outdated code cells, enhancing clarity and usability. * Refactor Spark configuration keys in create_spark function - Updated the configuration keys in the create_spark function within startup.py to use a more concise naming convention, changing 'spark.executor.memory', 'spark.executor.cores', and 'spark.executor.instances' to 'executor_memory', 'executor_cores', and 'executor_instances' respectively. - Adjusted the corresponding references in the Spark session creation logic to align with the new key names, improving consistency and readability of the configuration handling. * Refactor Spark configuration keys in create_spark function Updated the configuration keys in the create_spark function within startup.py to use the correct Spark naming convention, changing 'executor_memory', 'executor_cores', and 'executor_instances' to 'spark.executor.memory', 'spark.executor.cores', and 'spark.executor.instances'. Adjusted the corresponding references in the Spark session creation logic for improved consistency and clarity.
- Loading branch information
1 parent
0cf6d19
commit 02e3486
Showing
3 changed files
with
23 additions
and
181 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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