Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions qase-python-commons/src/qase/commons/models/config/batch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
from typing import Union

from ..basemodel import BaseModel


class BatchConfig(BaseModel):
size: int = None
size: int

def __init__(self):
self.size = 200

def set_size(self, size: int):
if size > 2000 or size == 0:
raise ValueError("Batch size should be greater than 0 and less than 2000")
self.size = size
def set_size(self, size: Union[int, str]):
try:
if isinstance(size, str):
size = size.strip()
size_int = int(size)
else:
size_int = size
if size_int > 2000 or size_int == 0:
self.size = size_int
Comment thread
meyafex marked this conversation as resolved.
Comment thread
meyafex marked this conversation as resolved.
except ValueError:
Comment thread
meyafex marked this conversation as resolved.
raise ValueError("Batch size should be numeric value")