Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshghorse committed May 17, 2024
1 parent 31cbd26 commit 33fc0be
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def __init__(
column_names: Optional[List[str]] = None,
condition_value_fn: Optional[ConditionValueFn] = None,
query_fn: Optional[QueryFn] = None,
min_batch_size: int = 1,
max_batch_size: int = 10000,
min_batch_size: Optional[int] = None,
max_batch_size: Optional[int] = None,
**kwargs,
):
"""
Expand Down Expand Up @@ -158,8 +158,10 @@ def __init__(
self.kwargs = kwargs
self._batching_kwargs = {}
if not query_fn:
self._batching_kwargs['min_batch_size'] = min_batch_size
self._batching_kwargs['max_batch_size'] = max_batch_size
self._batching_kwargs['min_batch_size'] = (
min_batch_size if min_batch_size else 1)
self._batching_kwargs['max_batch_size'] = (
max_batch_size if max_batch_size else 10000)

def __enter__(self):
self.client = bigquery.Client(project=self.project, **self.kwargs)
Expand Down

0 comments on commit 33fc0be

Please sign in to comment.