From 1f8fd78cfdfc9a9cdee559e2f2ca38747129e4b9 Mon Sep 17 00:00:00 2001 From: xuwenyihust Date: Thu, 22 Aug 2024 16:25:03 +0800 Subject: [PATCH] Update SparkApp configuration and test case for notebook path validation --- server/app/services/spark_app.py | 8 ++++---- server/tests/services/test_spark_app_service.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/app/services/spark_app.py b/server/app/services/spark_app.py index 48e623b..b608dc6 100644 --- a/server/app/services/spark_app.py +++ b/server/app/services/spark_app.py @@ -59,11 +59,11 @@ def get_spark_app_config_by_notebook_path(notbook_path: str = None): # Default spark app config spark_app_config = { 'spark.driver.memory': '1g', - 'spark.driver.cores': '1', + 'spark.driver.cores': 1, 'spark.executor.memory': '1g', - 'spark.executor.cores': '1', - 'spark.executor.instances': '1', - 'spark.dynamicAllocation.enabled': 'false', + 'spark.executor.cores': 1, + 'spark.executor.instances': 1, + 'spark.dynamicAllocation.enabled': False, } return Response( diff --git a/server/tests/services/test_spark_app_service.py b/server/tests/services/test_spark_app_service.py index 3702b86..3a47acd 100644 --- a/server/tests/services/test_spark_app_service.py +++ b/server/tests/services/test_spark_app_service.py @@ -92,11 +92,11 @@ def test_update_spark_app_config(self): # Update spark app config data = { 'spark.driver.memory': '2g', - 'spark.driver.cores': '1', + 'spark.driver.cores': 1, 'spark.executor.memory': '2g', - 'spark.executor.cores': '2', - 'spark.executor.instances': '2', - 'spark.dynamicAllocation.enabled': 'true', + 'spark.executor.cores': 2, + 'spark.executor.instances': 2, + 'spark.dynamicAllocation.enabled': True, } response_0 = SparkApp.update_spark_app_config_by_notebook_path(None, data=data)