Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 98974d0

Browse files
author
Sergey Vasilyev
committed
Restrict bisection threshold to pure integers
1 parent 598d98c commit 98974d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

data_diff/hashdiff_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class HashDiffer(TableDiffer):
7171
"""
7272

7373
bisection_factor: int = DEFAULT_BISECTION_FACTOR
74-
bisection_threshold: Number = DEFAULT_BISECTION_THRESHOLD # Accepts inf for tests
74+
bisection_threshold: int = DEFAULT_BISECTION_THRESHOLD
7575

7676
stats: dict = attrs.field(factory=dict)
7777

tests/test_database_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import sys
12
import unittest
23
import time
34
import json
45
import re
5-
import math
66
import uuid
77
from datetime import datetime, timedelta, timezone
88
import logging
@@ -765,7 +765,7 @@ def test_types(self, source_db, target_db, source_type, target_type, type_catego
765765
# reasonable amount of rows each. These will then be downloaded in
766766
# parallel, using the existing implementation.
767767
dl_factor = max(int(N_SAMPLES / 100_000), 2) if BENCHMARK else 2
768-
dl_threshold = int(N_SAMPLES / dl_factor) + 1 if BENCHMARK else math.inf
768+
dl_threshold = int(N_SAMPLES / dl_factor) + 1 if BENCHMARK else sys.maxsize
769769
dl_threads = N_THREADS
770770
differ = HashDiffer(
771771
bisection_threshold=dl_threshold, bisection_factor=dl_factor, max_threadpool_size=dl_threads

0 commit comments

Comments
 (0)