Skip to content

Commit 7264ebf

Browse files
lint
1 parent 5e867ad commit 7264ebf

File tree

3 files changed

+21
-25
lines changed

3 files changed

+21
-25
lines changed

packages/bigframes/bigframes/core/blocks.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,13 +2413,13 @@ def _align_both_axes(
24132413
rcol_indexer if (rcol_indexer is not None) else range(len(columns))
24142414
)
24152415

2416-
left_input_lookup = (
2417-
lambda index: ex.deref(get_column_left[self.value_columns[index]])
2416+
left_input_lookup = lambda index: (
2417+
ex.deref(get_column_left[self.value_columns[index]])
24182418
if index != -1
24192419
else ex.const(None)
24202420
)
2421-
righ_input_lookup = (
2422-
lambda index: ex.deref(get_column_right[other.value_columns[index]])
2421+
righ_input_lookup = lambda index: (
2422+
ex.deref(get_column_right[other.value_columns[index]])
24232423
if index != -1
24242424
else ex.const(None)
24252425
)
@@ -2472,15 +2472,13 @@ def _align_series_block_axis_1(
24722472
rcol_indexer if (rcol_indexer is not None) else range(len(columns))
24732473
)
24742474

2475-
left_input_lookup = (
2476-
lambda index: ex.deref(get_column_left[self.value_columns[index]])
2475+
left_input_lookup = lambda index: (
2476+
ex.deref(get_column_left[self.value_columns[index]])
24772477
if index != -1
24782478
else ex.const(None)
24792479
)
2480-
righ_input_lookup = (
2481-
lambda index: ex.deref(
2482-
get_column_right[other.transpose().value_columns[index]]
2483-
)
2480+
righ_input_lookup = lambda index: (
2481+
ex.deref(get_column_right[other.transpose().value_columns[index]])
24842482
if index != -1
24852483
else ex.const(None)
24862484
)
@@ -2507,13 +2505,11 @@ def _align_pd_series_axis_1(
25072505
rcol_indexer if (rcol_indexer is not None) else range(len(columns))
25082506
)
25092507

2510-
left_input_lookup = (
2511-
lambda index: ex.deref(self.value_columns[index])
2512-
if index != -1
2513-
else ex.const(None)
2508+
left_input_lookup = lambda index: (
2509+
ex.deref(self.value_columns[index]) if index != -1 else ex.const(None)
25142510
)
2515-
righ_input_lookup = (
2516-
lambda index: ex.const(other.iloc[index]) if index != -1 else ex.const(None)
2511+
righ_input_lookup = lambda index: (
2512+
ex.const(other.iloc[index]) if index != -1 else ex.const(None)
25172513
)
25182514

25192515
left_inputs = [left_input_lookup(i) for i in lcol_indexer]

packages/bigframes/bigframes/dataframe.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,9 @@ def sort_index(
24522452
else order.descending_over(column, na_last)
24532453
for column in index_columns
24542454
]
2455-
is_stable = (kind or constants.DEFAULT_SORT_KIND) in constants.STABLE_SORT_KINDS
2455+
is_stable = (
2456+
kind or constants.DEFAULT_SORT_KIND
2457+
) in constants.STABLE_SORT_KINDS
24562458
block = self._block.order_by(ordering, stable=is_stable)
24572459
else: # axis=1
24582460
_, indexer = self.columns.sort_values(
@@ -2773,11 +2775,11 @@ def replace(
27732775
):
27742776
if utils.is_dict_like(value):
27752777
return self.apply(
2776-
lambda x: x.replace(
2777-
to_replace=to_replace, value=value[x.name], regex=regex
2778+
lambda x: (
2779+
x.replace(to_replace=to_replace, value=value[x.name], regex=regex)
2780+
if (x.name in value)
2781+
else x
27782782
)
2779-
if (x.name in value)
2780-
else x
27812783
)
27822784
return self.apply(
27832785
lambda x: x.replace(to_replace=to_replace, value=value, regex=regex)

packages/bigframes/bigframes/series.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,8 +1821,7 @@ def sort_index(
18211821
ascending=...,
18221822
kind: str | None = ...,
18231823
na_position=...,
1824-
) -> Series:
1825-
...
1824+
) -> Series: ...
18261825

18271826
@typing.overload
18281827
def sort_index(
@@ -1833,8 +1832,7 @@ def sort_index(
18331832
ascending=...,
18341833
kind: str | None = ...,
18351834
na_position=...,
1836-
) -> None:
1837-
...
1835+
) -> None: ...
18381836

18391837
@validations.requires_index
18401838
def sort_index(

0 commit comments

Comments
 (0)