@@ -100,6 +100,8 @@ def test_unknown_overwrite_method_error(postgresql_table, postgresql_con):
100100def test_sql_types (postgresql_table , postgresql_con ):
101101 table = postgresql_table
102102 df = get_df ()
103+ df ["arrint" ] = pd .Series ([[1 , 2 , 3 ], [4 , 5 , 6 ], [7 , 8 , 9 ]])
104+ df ["arrstr" ] = pd .Series ([["a" , "b" , "c" ], ["d" , "e" , "f" ], ["g" , "h" , "i" ]])
103105 df .drop (["binary" ], axis = 1 , inplace = True )
104106 wr .postgresql .to_sql (
105107 df = df ,
@@ -108,7 +110,7 @@ def test_sql_types(postgresql_table, postgresql_con):
108110 schema = "public" ,
109111 mode = "overwrite" ,
110112 index = True ,
111- dtype = {"iint32" : "INTEGER" },
113+ dtype = {"iint32" : "INTEGER" , "arrint" : "INTEGER[]" , "arrstr" : "VARCHAR[]" },
112114 )
113115 df = wr .postgresql .read_sql_query (f"SELECT * FROM public.{ table } " , postgresql_con )
114116 ensure_data_types (df , has_list = False )
@@ -130,6 +132,8 @@ def test_sql_types(postgresql_table, postgresql_con):
130132 "timestamp" : pa .timestamp (unit = "ns" ),
131133 "binary" : pa .binary (),
132134 "category" : pa .float64 (),
135+ "arrint" : pa .list_ (pa .int64 ()),
136+ "arrstr" : pa .list_ (pa .string ()),
133137 },
134138 )
135139 for df in dfs :
0 commit comments