Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 9d942b6

Browse files
committed
chore: upgrade black and pre-commit
1 parent 827f5d5 commit 9d942b6

103 files changed

Lines changed: 596 additions & 624 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Generated by synthtool. DO NOT EDIT!
1817
[flake8]
19-
ignore = E203, E231, E266, E501, W503
18+
ignore = E203, E231, E266, E501, W503, E704
2019
exclude =
2120
# Exclude generated code.
2221
**/proto/**

.github/header-checker-lint.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
33
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
44
"sourceFileExtensions": [
5-
"ts",
6-
"js",
7-
"java",
8-
"sh",
9-
"Dockerfile",
10-
"yaml",
5+
"ts",
6+
"js",
7+
"java",
8+
"sh",
9+
"Dockerfile",
10+
"yaml",
1111
"py",
1212
"html",
1313
"txt"
1414
]
15-
}
15+
}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# See https://pre-commit.com/hooks.html for more hooks
1717
repos:
1818
- repo: https://github.com/pre-commit/pre-commit-hooks
19-
rev: v4.0.1
19+
rev: v5.0.0
2020
hooks:
2121
- id: trailing-whitespace
2222
- id: end-of-file-fixer
@@ -28,11 +28,11 @@ repos:
2828
- id: isort
2929
name: isort (python)
3030
- repo: https://github.com/psf/black
31-
rev: 22.3.0
31+
rev: 25.1.0
3232
hooks:
3333
- id: black
3434
- repo: https://github.com/pycqa/flake8
35-
rev: 7.1.2
35+
rev: 7.3.0
3636
hooks:
3737
- id: flake8
3838
- repo: https://github.com/pre-commit/mirrors-mypy

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ harassment or threats to anyone's safety, we may take action without notice.
9292

9393
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
9494
available at
95-
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
95+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

OWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ jiaxun@google.com
55
mlaurencechen@google.com
66
shobs@google.com
77
swast@google.com
8-
tbergeron@google.com
8+
tbergeron@google.com

bigframes/bigquery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""This module integrates BigQuery built-in functions for use with DataFrame objects,
1616
such as array functions:
17-
https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions. """
17+
https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions."""
1818

1919
from bigframes.bigquery._operations.approx_agg import approx_top_count
2020
from bigframes.bigquery._operations.array import (

bigframes/bigquery/_operations/struct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
"""This module integrates BigQuery built-in functions for use with DataFrame objects,
1717
such as array functions:
18-
https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions. """
18+
https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions."""
1919

2020

2121
from __future__ import annotations

bigframes/core/array_value.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,11 @@ def prepare_join_names(
524524
) -> Tuple[bigframes.core.nodes.BigFrameNode, dict[str, str]]:
525525
if set(other.node.ids) & set(self.node.ids):
526526
r_mapping = { # Rename conflicting names
527-
rcol.name: rcol.name
528-
if (rcol.name not in self.column_ids)
529-
else bigframes.core.guid.generate_guid()
527+
rcol.name: (
528+
rcol.name
529+
if (rcol.name not in self.column_ids)
530+
else bigframes.core.guid.generate_guid()
531+
)
530532
for rcol in other.node.ids
531533
}
532534
return (

bigframes/core/bigframe_node.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ def roots(self) -> typing.Set[BigFrameNode]:
155155
# TODO: Store some local data lazily for select, aggregate nodes.
156156
@property
157157
@abc.abstractmethod
158-
def fields(self) -> Sequence[field.Field]:
159-
...
158+
def fields(self) -> Sequence[field.Field]: ...
160159

161160
@property
162161
def ids(self) -> Iterable[identifiers.ColumnId]:
@@ -322,9 +321,9 @@ def iter_nodes_topo(self: BigFrameNode) -> Generator[BigFrameNode, None, None]:
322321
[node for node in self.unique_nodes() if not node.child_nodes]
323322
)
324323

325-
child_to_parents: Dict[
326-
BigFrameNode, Set[BigFrameNode]
327-
] = collections.defaultdict(set)
324+
child_to_parents: Dict[BigFrameNode, Set[BigFrameNode]] = (
325+
collections.defaultdict(set)
326+
)
328327
for parent, child in self.edges():
329328
child_to_parents[child].add(parent)
330329

bigframes/core/block_transforms.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,11 @@ def value_counts(
376376
[
377377
ordering.OrderingExpression(
378378
ex.deref(count_id),
379-
direction=ordering.OrderingDirection.ASC
380-
if ascending
381-
else ordering.OrderingDirection.DESC,
379+
direction=(
380+
ordering.OrderingDirection.ASC
381+
if ascending
382+
else ordering.OrderingDirection.DESC
383+
),
382384
)
383385
]
384386
)
@@ -435,22 +437,24 @@ def rank(
435437
window_ordering = (
436438
ordering.OrderingExpression(
437439
ex.deref(col),
438-
ordering.OrderingDirection.ASC
439-
if ascending
440-
else ordering.OrderingDirection.DESC,
440+
(
441+
ordering.OrderingDirection.ASC
442+
if ascending
443+
else ordering.OrderingDirection.DESC
444+
),
441445
na_last=(na_option in ["bottom", "keep"]),
442446
),
443447
)
444448
# Count_op ignores nulls, so if na_option is "top" or "bottom", we instead count the nullity columns, where nulls have been mapped to bools
445449
block, rownum_id = block.apply_window_op(
446450
col if na_option == "keep" else nullity_col_id,
447451
agg_ops.dense_rank_op if method == "dense" else agg_ops.count_op,
448-
window_spec=windows.unbound(
449-
grouping_keys=grouping_cols, ordering=window_ordering
450-
)
451-
if method == "dense"
452-
else windows.rows(
453-
end=0, ordering=window_ordering, grouping_keys=grouping_cols
452+
window_spec=(
453+
windows.unbound(grouping_keys=grouping_cols, ordering=window_ordering)
454+
if method == "dense"
455+
else windows.rows(
456+
end=0, ordering=window_ordering, grouping_keys=grouping_cols
457+
)
454458
),
455459
skip_reproject_unsafe=(col != columns[-1]),
456460
)

0 commit comments

Comments
 (0)