@@ -1937,7 +1937,7 @@ def test_aurora_postgres_load_special(bucket, postgres_parameters):
19371937 Decimal ((0 , (1 , 9 , 9 ), - 2 )),
19381938 Decimal ((0 , (1 , 9 , 9 ), - 2 )),
19391939 Decimal ((0 , (1 , 9 , 0 ), - 2 )),
1940- Decimal (( 0 , ( 3 , 1 , 2 ), - 2 ))
1940+ None
19411941 ]
19421942 })
19431943
@@ -1978,7 +1978,7 @@ def test_aurora_postgres_load_special(bucket, postgres_parameters):
19781978 assert rows [0 ][4 ] == Decimal ((0 , (1 , 9 , 9 ), - 2 ))
19791979 assert rows [1 ][4 ] == Decimal ((0 , (1 , 9 , 9 ), - 2 ))
19801980 assert rows [2 ][4 ] == Decimal ((0 , (1 , 9 , 0 ), - 2 ))
1981- assert rows [3 ][4 ] == Decimal (( 0 , ( 3 , 1 , 2 ), - 2 ))
1981+ assert rows [3 ][4 ] is None
19821982 conn .close ()
19831983
19841984
@@ -1992,7 +1992,7 @@ def test_aurora_mysql_load_special(bucket, mysql_parameters):
19921992 Decimal ((0 , (1 , 9 , 9 ), - 2 )),
19931993 Decimal ((0 , (1 , 9 , 9 ), - 2 )),
19941994 Decimal ((0 , (1 , 9 , 0 ), - 2 )),
1995- Decimal (( 0 , ( 3 , 1 , 2 ), - 2 ))
1995+ None
19961996 ]
19971997 })
19981998
@@ -2004,7 +2004,7 @@ def test_aurora_mysql_load_special(bucket, mysql_parameters):
20042004 mode = "overwrite" ,
20052005 temp_s3_path = path ,
20062006 engine = "mysql" ,
2007- procs_cpu_bound = 1 )
2007+ procs_cpu_bound = 4 )
20082008 conn = Aurora .generate_connection (database = "mysql" ,
20092009 host = mysql_parameters ["MysqlAddress" ],
20102010 port = 3306 ,
@@ -2033,7 +2033,7 @@ def test_aurora_mysql_load_special(bucket, mysql_parameters):
20332033 assert rows [0 ][4 ] == Decimal ((0 , (1 , 9 , 9 ), - 2 ))
20342034 assert rows [1 ][4 ] == Decimal ((0 , (1 , 9 , 9 ), - 2 ))
20352035 assert rows [2 ][4 ] == Decimal ((0 , (1 , 9 , 0 ), - 2 ))
2036- assert rows [3 ][4 ] == Decimal (( 0 , ( 3 , 1 , 2 ), - 2 ))
2036+ assert rows [3 ][4 ] is None
20372037 conn .close ()
20382038
20392039
@@ -2073,7 +2073,7 @@ def test_read_sql_athena_empty(ctas_approach):
20732073
20742074
20752075def test_aurora_postgres_load_special2 (bucket , postgres_parameters ):
2076- dt = lambda x : datetime .strptime (x , "%Y-%m-%d %H:%M:%S.%f" )
2076+ dt = lambda x : datetime .strptime (x , "%Y-%m-%d %H:%M:%S.%f" ) # noqa
20772077 df = pd .DataFrame ({
20782078 "integer1" : [0 , 1 , np .NaN , 3 ],
20792079 "integer2" : [8986 , 9735 , 9918 , 9150 ],
@@ -2084,11 +2084,17 @@ def test_aurora_postgres_load_special2(bucket, postgres_parameters):
20842084 "float1" : [0.0 , 1800000.0 , np .NaN , 0.0 ],
20852085 "string5" : ["0000296722" , "0000199396" , "0000298592" , "0000196380" ],
20862086 "string6" : [None , "C" , "C" , None ],
2087- "timestamp1" : [dt ("2020-01-07 00:00:00.000" ), None , dt ("2020-01-07 00:00:00.000" ),
2088- dt ("2020-01-07 00:00:00.000" )],
2087+ "timestamp1" :
2088+ [dt ("2020-01-07 00:00:00.000" ), None ,
2089+ dt ("2020-01-07 00:00:00.000" ),
2090+ dt ("2020-01-07 00:00:00.000" )],
20892091 "string7" : ["XXX" , "XXX" , "XXX" , "XXX" ],
2090- "timestamp2" : [dt ("2020-01-10 10:34:55.863" ), dt ("2020-01-10 10:34:55.864" ), dt ("2020-01-10 10:34:55.865" ),
2091- dt ("2020-01-10 10:34:55.866" )],
2092+ "timestamp2" : [
2093+ dt ("2020-01-10 10:34:55.863" ),
2094+ dt ("2020-01-10 10:34:55.864" ),
2095+ dt ("2020-01-10 10:34:55.865" ),
2096+ dt ("2020-01-10 10:34:55.866" )
2097+ ],
20922098 })
20932099 df = pd .concat ([df for _ in range (10_000 )])
20942100 path = f"s3://{ bucket } /test_aurora_postgres_special"
@@ -2098,8 +2104,7 @@ def test_aurora_postgres_load_special2(bucket, postgres_parameters):
20982104 table = "test_aurora_postgres_load_special2" ,
20992105 mode = "overwrite" ,
21002106 temp_s3_path = path ,
2101- engine = "postgres" ,
2102- procs_cpu_bound = 1 )
2107+ engine = "postgres" )
21032108 conn = Aurora .generate_connection (database = "postgres" ,
21042109 host = postgres_parameters ["PostgresAddress" ],
21052110 port = 3306 ,
@@ -2115,7 +2120,8 @@ def test_aurora_postgres_load_special2(bucket, postgres_parameters):
21152120 assert rows [1 ][0 ] == dt ("2020-01-10 10:34:55.864" )
21162121 assert rows [2 ][0 ] == dt ("2020-01-10 10:34:55.865" )
21172122 assert rows [3 ][0 ] == dt ("2020-01-10 10:34:55.866" )
2118- cursor .execute ("SELECT integer1, float1, string6, timestamp1 FROM public.test_aurora_postgres_load_special2 limit 4" )
2123+ cursor .execute (
2124+ "SELECT integer1, float1, string6, timestamp1 FROM public.test_aurora_postgres_load_special2 limit 4" )
21192125 rows = cursor .fetchall ()
21202126 assert rows [2 ][0 ] is None
21212127 assert rows [2 ][1 ] is None
@@ -2125,7 +2131,7 @@ def test_aurora_postgres_load_special2(bucket, postgres_parameters):
21252131
21262132
21272133def test_aurora_mysql_load_special2 (bucket , mysql_parameters ):
2128- dt = lambda x : datetime .strptime (x , "%Y-%m-%d %H:%M:%S.%f" )
2134+ dt = lambda x : datetime .strptime (x , "%Y-%m-%d %H:%M:%S.%f" ) # noqa
21292135 df = pd .DataFrame ({
21302136 "integer1" : [0 , 1 , np .NaN , 3 ],
21312137 "integer2" : [8986 , 9735 , 9918 , 9150 ],
@@ -2136,11 +2142,17 @@ def test_aurora_mysql_load_special2(bucket, mysql_parameters):
21362142 "float1" : [0.0 , 1800000.0 , np .NaN , 0.0 ],
21372143 "string5" : ["0000296722" , "0000199396" , "0000298592" , "0000196380" ],
21382144 "string6" : [None , "C" , "C" , None ],
2139- "timestamp1" : [dt ("2020-01-07 00:00:00.000" ), None , dt ("2020-01-07 00:00:00.000" ),
2140- dt ("2020-01-07 00:00:00.000" )],
2145+ "timestamp1" :
2146+ [dt ("2020-01-07 00:00:00.000" ), None ,
2147+ dt ("2020-01-07 00:00:00.000" ),
2148+ dt ("2020-01-07 00:00:00.000" )],
21412149 "string7" : ["XXX" , "XXX" , "XXX" , "XXX" ],
2142- "timestamp2" : [dt ("2020-01-10 10:34:55.863" ), dt ("2020-01-10 10:34:55.864" ), dt ("2020-01-10 10:34:55.865" ),
2143- dt ("2020-01-10 10:34:55.866" )],
2150+ "timestamp2" : [
2151+ dt ("2020-01-10 10:34:55.863" ),
2152+ dt ("2020-01-10 10:34:55.864" ),
2153+ dt ("2020-01-10 10:34:55.865" ),
2154+ dt ("2020-01-10 10:34:55.866" )
2155+ ],
21442156 })
21452157 df = pd .concat ([df for _ in range (10_000 )])
21462158 path = f"s3://{ bucket } /test_aurora_mysql_load_special2"
@@ -2150,8 +2162,7 @@ def test_aurora_mysql_load_special2(bucket, mysql_parameters):
21502162 table = "test_aurora_mysql_load_special2" ,
21512163 mode = "overwrite" ,
21522164 temp_s3_path = path ,
2153- engine = "mysql" ,
2154- procs_cpu_bound = 1 )
2165+ engine = "mysql" )
21552166 conn = Aurora .generate_connection (database = "mysql" ,
21562167 host = mysql_parameters ["MysqlAddress" ],
21572168 port = 3306 ,
@@ -2161,8 +2172,7 @@ def test_aurora_mysql_load_special2(bucket, mysql_parameters):
21612172 with conn .cursor () as cursor :
21622173 cursor .execute ("SELECT count(*) FROM test.test_aurora_mysql_load_special2" )
21632174 assert cursor .fetchall ()[0 ][0 ] == len (df .index )
2164- cursor .execute (
2165- "SELECT integer1, float1, string6, timestamp1 FROM test.test_aurora_mysql_load_special2 limit 4" )
2175+ cursor .execute ("SELECT integer1, float1, string6, timestamp1 FROM test.test_aurora_mysql_load_special2 limit 4" )
21662176 rows = cursor .fetchall ()
21672177 assert rows [2 ][0 ] is None
21682178 assert rows [2 ][1 ] is None
0 commit comments