From 740f50a3d6dfe4dff18cfba10900641102a8b5ea Mon Sep 17 00:00:00 2001 From: rileyh Date: Wed, 9 Oct 2024 16:24:50 +0000 Subject: [PATCH] [#153] Add a test for the default Spark app name --- hlink/tests/spark_connection_test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 hlink/tests/spark_connection_test.py diff --git a/hlink/tests/spark_connection_test.py b/hlink/tests/spark_connection_test.py new file mode 100644 index 0000000..4fb331f --- /dev/null +++ b/hlink/tests/spark_connection_test.py @@ -0,0 +1,16 @@ +from pathlib import Path +import sys + +from hlink.spark.session import SparkConnection + + +def test_app_name_defaults_to_linking(tmp_path: Path) -> None: + derby_dir = tmp_path / "derby" + warehouse_dir = tmp_path / "warehouse" + tmp_dir = tmp_path / "tmp" + connection = SparkConnection( + derby_dir, warehouse_dir, tmp_dir, sys.executable, "test" + ) + spark = connection.local(cores=1, executor_memory="1G") + app_name = spark.conf.get("spark.app.name") + assert app_name == "linking"