Skip to content

Commit 0d9abb3

Browse files
authored
chore(bigframes): check unused import and variables in nox commands (#17264)
Added "F" (Pyflakes) rules to the nox commands, which check unused imports and variables.
1 parent 9c535b2 commit 0d9abb3

25 files changed

Lines changed: 18 additions & 61 deletions

File tree

packages/bigframes/bigframes/_config/auth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import pydata_google_auth
2424

2525
import bigframes._config.bigquery_options as bigquery_options
26-
from bigframes._config import options
2726

2827
_SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]
2928

packages/bigframes/bigframes/bigquery/_operations/array.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import bigframes_vendored.constants as constants
2525

2626
import bigframes.core.groupby as groupby
27-
import bigframes.operations as ops
2827
import bigframes.operations.aggregations as agg_ops
2928
import bigframes.series as series
3029

packages/bigframes/bigframes/core/compile/ibis_compiler/scalar_op_compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def googlesql_scalar_op_impl(
308308
)
309309
arg_spec = op.args[-1]
310310
if isinstance(operand.op(), ibis_generic.OmittedArg):
311-
assert arg_spec.optional, f"Argument omitted, but not optional"
311+
assert arg_spec.optional, "Argument omitted, but not optional"
312312
continue
313313

314314
target_idx = len(final_operands)

packages/bigframes/bigframes/core/compile/sqlglot/expressions/generic_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _(*operands: TypedExpr, op: ops.GoogleSqlScalarOp) -> sge.Expression:
9494
)
9595
arg_spec = op.args[-1]
9696
if operand.is_omitted:
97-
assert arg_spec.optional, f"Argument omitted, but not optional"
97+
assert arg_spec.optional, "Argument omitted, but not optional"
9898
continue
9999
elif arg_spec.arg_name:
100100
args.append(sge.Kwarg(this=arg_spec.arg_name, expression=operand.expr))

packages/bigframes/bigframes/core/nodes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from bigframes.core.ordering import OrderingExpression, RowOrdering
4141

4242
if typing.TYPE_CHECKING:
43-
import bigframes.core.ordering as orderings
4443
import bigframes.session
4544

4645

packages/bigframes/bigframes/operations/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@
426426
"GeoStDistanceOp",
427427
"GeoStLengthOp",
428428
"GeoStRegionStatsOp",
429+
"GeoStSimplifyOp",
429430
# AI ops
430431
"AIClassify",
431432
"AIGenerate",

packages/bigframes/bigframes/operations/googlesql/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717

1818
import dataclasses
1919
import typing
20-
from enum import Enum, auto
21-
from typing import Callable, Iterable
2220

2321
import bigframes.operations as ops
24-
import bigframes.operations.type as op_typing
2522
from bigframes import dtypes
2623

2724

packages/bigframes/bigframes/operations/googlesql/aead.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818

1919
from __future__ import annotations
2020

21-
import datetime
22-
import decimal
23-
from typing import Any, Literal, Optional, TypeVar, Union
21+
from typing import Literal, Union
2422

2523
import bigframes.core.col
26-
import bigframes.core.expression as ex
2724
import bigframes.core.googlesql
2825
import bigframes.core.sentinels as sentinels
29-
import bigframes.operations as ops
3026
import bigframes.series as series
3127
from bigframes import dtypes
3228
from bigframes.operations import googlesql

packages/bigframes/bigframes/operations/googlesql/global_namespace/aead_encryption.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@
1818

1919
from __future__ import annotations
2020

21-
import datetime
22-
import decimal
23-
from typing import Any, Literal, Optional, TypeVar, Union
21+
from typing import Literal, Union
2422

2523
import bigframes.core.col
26-
import bigframes.core.expression as ex
2724
import bigframes.core.googlesql
2825
import bigframes.core.sentinels as sentinels
29-
import bigframes.operations as ops
3026
import bigframes.series as series
3127
from bigframes import dtypes
3228
from bigframes.operations import googlesql

packages/bigframes/bigframes/operations/googlesql/global_namespace/array.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818

1919
from __future__ import annotations
2020

21-
import datetime
2221
import decimal
23-
from typing import Any, Literal, Optional, TypeVar, Union
22+
from typing import Any, Literal, Union
2423

2524
import bigframes.core.col
26-
import bigframes.core.expression as ex
2725
import bigframes.core.googlesql
2826
import bigframes.core.sentinels as sentinels
29-
import bigframes.operations as ops
3027
import bigframes.series as series
3128
from bigframes import dtypes
3229
from bigframes.operations import googlesql
@@ -301,7 +298,6 @@ def _ARRAY_TO_STRING_SIG(*args):
301298
# Pad args with None to match max expected args
302299
args = args + (None,) * (3 - len(args))
303300
# Try matching impl 0
304-
any1_val = None
305301
match_ok = True
306302
if match_ok and args[0] is not None:
307303
if not dtypes.is_array_like(args[0]):
@@ -338,7 +334,6 @@ def _ARRAY_TO_STRING_SIG(*args):
338334
return dtypes.STRING_DTYPE
339335

340336
# Try matching impl 1
341-
any1_val = None
342337
match_ok = True
343338
if match_ok and args[0] is not None:
344339
if not dtypes.is_array_like(args[0]):
@@ -432,7 +427,6 @@ def _GENERATE_ARRAY_SIG(*args):
432427
# Pad args with None to match max expected args
433428
args = args + (None,) * (3 - len(args))
434429
# Try matching impl 0
435-
any1_val = None
436430
match_ok = True
437431
if match_ok and args[0] is not None:
438432
try:
@@ -456,7 +450,6 @@ def _GENERATE_ARRAY_SIG(*args):
456450
return dtypes.list_type(dtypes.INT_DTYPE)
457451

458452
# Try matching impl 1
459-
any1_val = None
460453
match_ok = True
461454
if match_ok and args[0] is not None:
462455
try:
@@ -489,7 +482,6 @@ def _GENERATE_ARRAY_SIG(*args):
489482
return dtypes.list_type(dtypes.NUMERIC_DTYPE)
490483

491484
# Try matching impl 2
492-
any1_val = None
493485
match_ok = True
494486
if match_ok and args[0] is not None:
495487
try:

0 commit comments

Comments
 (0)