@@ -100,6 +100,8 @@ def test_unknown_overwrite_method_error(postgresql_table, postgresql_con):
100
100
def test_sql_types (postgresql_table , postgresql_con ):
101
101
table = postgresql_table
102
102
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" ]])
103
105
df .drop (["binary" ], axis = 1 , inplace = True )
104
106
wr .postgresql .to_sql (
105
107
df = df ,
@@ -108,7 +110,7 @@ def test_sql_types(postgresql_table, postgresql_con):
108
110
schema = "public" ,
109
111
mode = "overwrite" ,
110
112
index = True ,
111
- dtype = {"iint32" : "INTEGER" },
113
+ dtype = {"iint32" : "INTEGER" , "arrint" : "INTEGER[]" , "arrstr" : "VARCHAR[]" },
112
114
)
113
115
df = wr .postgresql .read_sql_query (f"SELECT * FROM public.{ table } " , postgresql_con )
114
116
ensure_data_types (df , has_list = False )
@@ -130,6 +132,8 @@ def test_sql_types(postgresql_table, postgresql_con):
130
132
"timestamp" : pa .timestamp (unit = "ns" ),
131
133
"binary" : pa .binary (),
132
134
"category" : pa .float64 (),
135
+ "arrint" : pa .list_ (pa .int64 ()),
136
+ "arrstr" : pa .list_ (pa .string ()),
133
137
},
134
138
)
135
139
for df in dfs :
0 commit comments