Skip to content

Commit 633ed7d

Browse files
committed
Formatting
1 parent e128ee2 commit 633ed7d

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

google/cloud/dataproc_spark_connect/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def getOrCreate(self) -> "DataprocSparkSession":
596596
raise DataprocSparkConnectException(
597597
f"Error while creating Dataproc Session: project ID is not set"
598598
)
599-
599+
600600
if self._region is None:
601601
raise DataprocSparkConnectException(
602602
f"Error while creating Dataproc Session: location is not set"

tests/integration/test_session.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -791,19 +791,3 @@ def test_create_local_spark_session(batch_workload_env, local_spark_session):
791791
assert dataproc_spark_session == local_spark_session
792792
finally:
793793
dataproc_spark_session.stop()
794-
795-
def test_create_session_without_project_id(test_region):
796-
"""Tests that an exception is raised when project ID is not provided."""
797-
with pytest.raises(ValueError, match="Project ID must be specified"):
798-
(
799-
DataprocSparkSession.builder.location(test_region)
800-
.getOrCreate()
801-
)
802-
803-
def test_create_session_without_location(test_project):
804-
"""Tests that an exception is raised when location is not provided."""
805-
with pytest.raises(ValueError, match="Location must be specified"):
806-
(
807-
DataprocSparkSession.builder.projectId(test_project)
808-
.getOrCreate()
809-
)

tests/unit/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,6 @@ def test_create_session_without_project_id(self):
14791479
except DataprocSparkConnectException as e:
14801480
self.assertIn("project ID is not set", str(e))
14811481

1482-
14831482
def test_create_session_without_location(self):
14841483
"""Tests that an exception is raised when location is not provided."""
14851484
os.environ.clear()
@@ -1488,6 +1487,7 @@ def test_create_session_without_location(self):
14881487
except DataprocSparkConnectException as e:
14891488
self.assertIn("location is not set", str(e))
14901489

1490+
14911491
class DataprocSparkConnectClientTest(unittest.TestCase):
14921492

14931493
def setUp(self):

0 commit comments

Comments
 (0)