Skip to content

Commit

Permalink
Fix new mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkkul committed Mar 11, 2024
1 parent b76d9ce commit 0922e7d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions weaviate/batch/crud_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,9 @@ class NonExistingClass not present"
self._objects_throughput_frame
)

self._recommended_num_objects = max(round(obj_per_second * self._creation_time), 1)
self._recommended_num_objects = max(
round(obj_per_second * float(self._creation_time)), 1
)

res = _decode_json_response_list(response, "batch add objects")
assert res is not None
Expand Down Expand Up @@ -1065,7 +1067,7 @@ def create_references(self) -> list:
self._references_throughput_frame
)

self._recommended_num_references = round(ref_per_sec * self._creation_time)
self._recommended_num_references = round(ref_per_sec * float(self._creation_time))

res = _decode_json_response_list(response, "Create references")
assert res is not None
Expand Down Expand Up @@ -1172,7 +1174,7 @@ def _send_batch_requests(self, force_wait: bool) -> None:
)
self._recommended_num_objects = max(
min(
round(obj_per_second * self._creation_time),
round(obj_per_second * float(self._creation_time)),
self._recommended_num_objects + 250,
),
1,
Expand Down Expand Up @@ -1210,7 +1212,7 @@ def _send_batch_requests(self, force_wait: bool) -> None:
self._references_throughput_frame
)
self._recommended_num_references = min(
round(ref_per_sec * self._creation_time),
round(ref_per_sec * float(self._creation_time)),
self._recommended_num_references * 2,
)

Expand Down Expand Up @@ -1742,11 +1744,11 @@ def creation_time(self, value: Real) -> None:
_check_positive_num(value, "creation_time", Real)
if self._recommended_num_references is not None:
self._recommended_num_references = round(
self._recommended_num_references * value / self._creation_time
self._recommended_num_references * float(value) / float(self._creation_time)
)
if self._recommended_num_objects is not None:
self._recommended_num_objects = round(
self._recommended_num_objects * value / self._creation_time
self._recommended_num_objects * float(value) / float(self._creation_time)
)
self._creation_time = value
if self._batching_type:
Expand Down

0 comments on commit 0922e7d

Please sign in to comment.