@@ -72,12 +72,14 @@ def test_read_data_with_options():
7272 spark .read .format .assert_called_with ("jdbc" )
7373 spark .read .format ().option .assert_called_with (
7474 "url" ,
75- "jdbc:oracle:thin:my_user/my_password @//my_host:777/my_database" ,
75+ "jdbc:oracle:thin@//my_host:777/my_database" ,
7676 )
7777 spark .read .format ().option ().option .assert_called_with ("driver" , "oracle.jdbc.driver.OracleDriver" )
7878 spark .read .format ().option ().option ().option .assert_called_with ("dbtable" , "(select 1 from data.employee) tmp" )
79- actual_args = spark .read .format ().option ().option ().option ().options .call_args .kwargs
80- expected_args = {
79+ spark .read .format ().option ().option ().option ().option .assert_called_with ("user" , "my_user" )
80+ spark .read .format ().option ().option ().option ().option ().option .assert_called_with ("password" , "my_password" )
81+ jdbc_actual_args = spark .read .format ().option ().option ().option ().option ().option ().options .call_args .kwargs
82+ jdbc_expected_args = {
8183 "numPartitions" : 50 ,
8284 "partitionColumn" : "s_nationkey" ,
8385 "lowerBound" : '0' ,
@@ -88,8 +90,8 @@ def test_read_data_with_options():
8890 r"'''YYYY-MM-DD''');dbms_session.set_nls('nls_timestamp_format', '''YYYY-MM-DD "
8991 r"HH24:MI:SS''');END;" ,
9092 }
91- assert actual_args == expected_args
92- spark .read .format ().option ().option ().option ().options ().load .assert_called_once ()
93+ assert jdbc_actual_args == jdbc_expected_args
94+ spark .read .format ().option ().option ().option ().option (). option (). options ().load .assert_called_once ()
9395
9496
9597def test_get_schema ():
@@ -141,7 +143,7 @@ def test_read_data_exception_handling():
141143 filters = None ,
142144 )
143145
144- spark .read .format ().option ().option ().option ().options ().load .side_effect = RuntimeError ("Test Exception" )
146+ spark .read .format ().option ().option ().option ().option (). option (). options ().load .side_effect = RuntimeError ("Test Exception" )
145147
146148 # Call the read_data method with the Tables configuration and assert that a PySparkException is raised
147149 with pytest .raises (
@@ -156,7 +158,7 @@ def test_get_schema_exception_handling():
156158 engine , spark , ws , scope = initial_setup ()
157159 ords = OracleDataSource (engine , spark , ws , scope )
158160
159- spark .read .format ().option ().option ().option ().load .side_effect = RuntimeError ("Test Exception" )
161+ spark .read .format ().option ().option ().option ().option (). option (). load .side_effect = RuntimeError ("Test Exception" )
160162
161163 # Call the get_schema method with predefined table, schema, and catalog names and assert that a PySparkException
162164 # is raised
0 commit comments