Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Spark Connect to pyspark decorator #35665

Merged
merged 5 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename so it doesn't get collected
  • Loading branch information
bolkedebruin committed Nov 16, 2023
commit 50a9c4db1759e26affe68ab26b3edfc6faebf13b
10 changes: 5 additions & 5 deletions tests/providers/apache/spark/decorators/test_pyspark.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
DEFAULT_DATE = timezone.datetime(2021, 9, 1)


class TestConfig:
class FakeConfig:
data: dict[str, Any]

def __init__(self, data: dict[str, Any] | None = None):
@@ -81,7 +81,7 @@ def setup_method(self):
@mock.patch("pyspark.SparkConf")
@mock.patch("pyspark.sql.SparkSession")
def test_pyspark_decorator_with_connection(self, spark_mock, conf_mock, dag_maker):
config = TestConfig()
config = FakeConfig()

builder = mock.MagicMock()
spark_mock.builder.config.return_value = builder
@@ -116,7 +116,7 @@ def f(spark, sc):
@mock.patch("pyspark.SparkConf")
@mock.patch("pyspark.sql.SparkSession")
def test_simple_pyspark_decorator(self, spark_mock, conf_mock, dag_maker):
config = TestConfig()
config = FakeConfig()
conf_mock.return_value = config

e = 2
@@ -139,7 +139,7 @@ def f():
@mock.patch("pyspark.SparkConf")
@mock.patch("pyspark.sql.SparkSession")
def test_spark_connect(self, spark_mock, conf_mock, dag_maker):
config = TestConfig()
config = FakeConfig()
conf_mock.return_value = config

@task.pyspark(conn_id="spark-connect")
@@ -165,7 +165,7 @@ def f(spark, sc):
@mock.patch("pyspark.SparkConf")
@mock.patch("pyspark.sql.SparkSession")
def test_spark_connect_auth(self, spark_mock, conf_mock, dag_maker):
config = TestConfig()
config = FakeConfig()
conf_mock.return_value = config

@task.pyspark(conn_id="spark-connect-auth")