Skip to content

Commit 30474ed

Browse files
authored
Merge pull request #66 from qaspen-python/hotfix/minimal_array_size
Fixed minimal array size
2 parents 8bbf7d7 + fb7e750 commit 30474ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/value_converter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ impl ToSql for PythonDTO {
264264
for inner in py_iterable {
265265
items.push(inner);
266266
}
267-
if items.len() > 1 {
268-
items.to_sql(&items[0].array_type()?, out)?;
269-
} else {
267+
if items.is_empty() {
270268
return_is_null_true = true;
269+
} else {
270+
items.to_sql(&items[0].array_type()?, out)?;
271271
}
272272
}
273273
PythonDTO::PyJsonb(py_dict) | PythonDTO::PyJson(py_dict) => {

0 commit comments

Comments
 (0)