Skip to content

Commit 9257c5c

Browse files
committed
update black to 23.7.0
1 parent 71ef8f3 commit 9257c5c

39 files changed

+42
-84
lines changed

bigframes/_config/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
_cached_project_default: Optional[str] = None
3131

3232

33-
def get_default_credentials_with_project() -> tuple[
34-
google.auth.credentials.Credentials, Optional[str]
35-
]:
33+
def get_default_credentials_with_project() -> (
34+
tuple[google.auth.credentials.Credentials, Optional[str]]
35+
):
3636
global _AUTH_LOCK, _cached_credentials, _cached_project_default
3737

3838
with _AUTH_LOCK:

bigframes/core/block_transforms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ def skew(
618618
skew_column_ids: typing.Sequence[str],
619619
grouping_column_ids: typing.Sequence[str] = (),
620620
) -> blocks.Block:
621-
622621
original_columns = skew_column_ids
623622
column_labels = block.select_columns(original_columns).column_labels
624623

bigframes/core/blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ def _get_sampling_option(
650650
sampling_method: Optional[str] = None,
651651
random_state: Optional[int] = None,
652652
) -> sampling_options.SamplingOptions:
653-
654653
if (sampling_method is not None) and (sampling_method not in _SAMPLING_METHODS):
655654
raise NotImplementedError(
656655
f"The downsampling method {sampling_method} is not implemented, "
@@ -693,7 +692,8 @@ def to_pandas_batches(
693692
"""Download results one message at a time.
694693
695694
page_size and max_results determine the size and number of batches,
696-
see https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob#google_cloud_bigquery_job_QueryJob_result"""
695+
see https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob#google_cloud_bigquery_job_QueryJob_result
696+
"""
697697

698698
under_10gb = (
699699
(not allow_large_results)

bigframes/core/compile/ibis_compiler/scalar_op_registry.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,6 @@ def struct_op_impl(
18881888
def ai_generate(
18891889
*values: ibis_types.Value, op: ops.AIGenerate
18901890
) -> ibis_types.StructValue:
1891-
18921891
return ai_ops.AIGenerate(
18931892
_construct_prompt(values, op.prompt_context), # type: ignore
18941893
op.connection_id, # type: ignore
@@ -1903,7 +1902,6 @@ def ai_generate(
19031902
def ai_generate_bool(
19041903
*values: ibis_types.Value, op: ops.AIGenerateBool
19051904
) -> ibis_types.StructValue:
1906-
19071905
return ai_ops.AIGenerateBool(
19081906
_construct_prompt(values, op.prompt_context), # type: ignore
19091907
op.connection_id, # type: ignore
@@ -1917,7 +1915,6 @@ def ai_generate_bool(
19171915
def ai_generate_int(
19181916
*values: ibis_types.Value, op: ops.AIGenerateInt
19191917
) -> ibis_types.StructValue:
1920-
19211918
return ai_ops.AIGenerateInt(
19221919
_construct_prompt(values, op.prompt_context), # type: ignore
19231920
op.connection_id, # type: ignore
@@ -1931,7 +1928,6 @@ def ai_generate_int(
19311928
def ai_generate_double(
19321929
*values: ibis_types.Value, op: ops.AIGenerateDouble
19331930
) -> ibis_types.StructValue:
1934-
19351931
return ai_ops.AIGenerateDouble(
19361932
_construct_prompt(values, op.prompt_context), # type: ignore
19371933
op.connection_id, # type: ignore
@@ -1943,7 +1939,6 @@ def ai_generate_double(
19431939

19441940
@scalar_op_compiler.register_nary_op(ops.AIIf, pass_op=True)
19451941
def ai_if(*values: ibis_types.Value, op: ops.AIIf) -> ibis_types.StructValue:
1946-
19471942
return ai_ops.AIIf(
19481943
_construct_prompt(values, op.prompt_context), # type: ignore
19491944
op.connection_id, # type: ignore
@@ -1954,7 +1949,6 @@ def ai_if(*values: ibis_types.Value, op: ops.AIIf) -> ibis_types.StructValue:
19541949
def ai_classify(
19551950
*values: ibis_types.Value, op: ops.AIClassify
19561951
) -> ibis_types.StructValue:
1957-
19581952
return ai_ops.AIClassify(
19591953
_construct_prompt(values, op.prompt_context), # type: ignore
19601954
op.categories, # type: ignore
@@ -1964,7 +1958,6 @@ def ai_classify(
19641958

19651959
@scalar_op_compiler.register_nary_op(ops.AIScore, pass_op=True)
19661960
def ai_score(*values: ibis_types.Value, op: ops.AIScore) -> ibis_types.StructValue:
1967-
19681961
return ai_ops.AIScore(
19691962
_construct_prompt(values, op.prompt_context), # type: ignore
19701963
op.connection_id, # type: ignore

bigframes/core/expression_factoring.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def graph_extract_scalar_exprs() -> Sequence[nodes.ColumnDef]:
167167
# TODO: We can prune expressions that won't be reused here,
168168
return tuple(nodes.ColumnDef(expr, id) for id, expr in results.items())
169169

170-
def graph_extract_window_expr() -> Optional[
171-
Tuple[Sequence[nodes.ColumnDef], window_spec.WindowSpec]
172-
]:
170+
def graph_extract_window_expr() -> (
171+
Optional[Tuple[Sequence[nodes.ColumnDef], window_spec.WindowSpec]]
172+
):
173173
for id in graph.sinks:
174174
next_def = by_id[id]
175175
if isinstance(next_def.expression, agg_expressions.WindowExpression):

bigframes/core/indexes/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def is_monotonic_increasing(self) -> bool:
210210
@property
211211
@validations.requires_ordering()
212212
def is_monotonic_decreasing(self) -> bool:
213-
214213
return typing.cast(
215214
bool,
216215
self._block.is_monotonic_decreasing(self._block.index_columns),

bigframes/core/window/rolling.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ def create_range_window(
217217
grouping_keys: Sequence[str] = tuple(),
218218
drop_null_groups: bool = True,
219219
) -> Window:
220-
221220
if on is None:
222221
# Rolling on index
223222
index_dtypes = block.index.dtypes

bigframes/ml/cluster.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class KMeans(
4444
base.UnsupervisedTrainablePredictor,
4545
bigframes_vendored.sklearn.cluster._kmeans.KMeans,
4646
):
47-
4847
__doc__ = bigframes_vendored.sklearn.cluster._kmeans.KMeans.__doc__
4948

5049
def __init__(

bigframes/ml/decomposition.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ def __init__(
226226
# TODO: Add support for hyperparameter tuning.
227227
l2_reg: float = 1.0,
228228
):
229-
230229
feedback_type = feedback_type.lower() # type: ignore
231230
if feedback_type not in ("explicit", "implicit"):
232231
raise ValueError("Expected feedback_type to be `explicit` or `implicit`.")

bigframes/ml/ensemble.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ class XGBClassifier(
213213
base.SupervisedTrainableWithEvaluationPredictor,
214214
bigframes_vendored.xgboost.sklearn.XGBClassifier,
215215
):
216-
217216
__doc__ = bigframes_vendored.xgboost.sklearn.XGBClassifier.__doc__
218217

219218
def __init__(
@@ -370,7 +369,6 @@ class RandomForestRegressor(
370369
base.SupervisedTrainableWithEvaluationPredictor,
371370
bigframes_vendored.sklearn.ensemble._forest.RandomForestRegressor,
372371
):
373-
374372
__doc__ = bigframes_vendored.sklearn.ensemble._forest.RandomForestRegressor.__doc__
375373

376374
def __init__(
@@ -536,7 +534,6 @@ class RandomForestClassifier(
536534
base.SupervisedTrainableWithEvaluationPredictor,
537535
bigframes_vendored.sklearn.ensemble._forest.RandomForestClassifier,
538536
):
539-
540537
__doc__ = bigframes_vendored.sklearn.ensemble._forest.RandomForestClassifier.__doc__
541538

542539
def __init__(

0 commit comments

Comments
 (0)