Skip to content

Commit 4a37e32

Browse files
authored
raise an error when batch_size is zero. (#259)
1 parent b311485 commit 4a37e32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mssql/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def bulk_update_with_default(self, objs, fields, batch_size=None, default=0):
292292
SQL Server require that at least one of the result expressions in a CASE specification must be an expression other than the NULL constant.
293293
Patched with a default value 0. The user can also pass a custom default value for CASE statement.
294294
"""
295-
if batch_size is not None and batch_size < 0:
295+
if batch_size is not None and batch_size <= 0:
296296
raise ValueError('Batch size must be a positive integer.')
297297
if not fields:
298298
raise ValueError('Field names must be given to bulk_update().')

0 commit comments

Comments
 (0)