File tree Expand file tree Collapse file tree
google/cloud/dataproc_spark_connect Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ def _get_exiting_active_session(
519519 self ,
520520 ) -> Optional ["DataprocSparkSession" ]:
521521 s8s_session_id = DataprocSparkSession ._active_s8s_session_id
522- session_name = f"projects/{ self ._project_id } /locations/{ self ._region } /sessions/{ s8s_session_id } "
522+ session_name = f"sc:// projects/{ self ._project_id } /locations/{ self ._region } /sessions/{ s8s_session_id } "
523523 session_response = None
524524 session = None
525525 if s8s_session_id is not None :
Original file line number Diff line number Diff line change @@ -2312,18 +2312,20 @@ def test_create_session_with_client_environment_label(
23122312 expected_request .session .labels ["dataproc-session-client" ] = (
23132313 env_label
23142314 )
2315+ expected_request .session .environment_config .execution_config .subnetwork_uri = "projects/google.com:hadoop-cloud-dev/regions/us-central1/subnetworks/svls-bugbash-vpc"
23152316
23162317 try :
23172318 # Reset singleton state before each subtest run
23182319 DataprocSparkSession ._active_s8s_session_id = None
23192320 DataprocSparkSession ._default_session = None
23202321
2321- # Set up project and region for the builder
2322- session = (
2323- DataprocSparkSession .builder .projectId ("test-project" )
2324- .location ("test-region" )
2325- .getOrCreate ()
2326- )
2322+ with mock .patch .dict (os .environ , {"DATAPROC_SPARK_CONNECT_SUBNET" : "projects/google.com:hadoop-cloud-dev/regions/us-central1/subnetworks/svls-bugbash-vpc" }):
2323+ # Set up project and region for the builder
2324+ session = (
2325+ DataprocSparkSession .builder .projectId ("test-project" )
2326+ .location ("test-region" )
2327+ .getOrCreate ()
2328+ )
23272329
23282330 mock_get_client_environment_label .assert_called_once ()
23292331 mock_session_controller_client_instance .create_session .assert_called_once_with (
You can’t perform that action at this time.
0 commit comments