Skip to content

chore(bigquery): sync bigquery ruff with the global config - #19056

Open
tswast wants to merge 1 commit into
mainfrom
tswast-pre-commit
Open

tswast wants to merge 1 commit into
mainfrom
tswast-pre-commit

Conversation

@tswast

@tswast tswast commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@tswast
tswast requested review from a team as code owners November 12, 2026 17:15
@tswast
tswast requested review from sycai and removed request for a team November 12, 2026 17:15

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces Black and Isort with Ruff for code formatting and import sorting across multiple packages, deprecating the legacy blacken Nox sessions in favor of Ruff-based formatting. It also introduces or updates pyproject.toml configurations for Ruff. The review feedback recommends defining the target-version directly within each pyproject.toml file to ensure consistency across environments and to simplify the noxfile.py configurations by removing redundant command-line arguments.

Comment on lines +19 to +20
[tool.ruff]
line-length = 88

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Configuring target-version directly in pyproject.toml is a best practice for Ruff. It ensures that IDEs, pre-commit hooks, and manual CLI runs all use the correct target Python version consistently without needing to pass it as a command-line argument. This also allows simplifying the noxfile.py configurations across all packages.

Suggested change
[tool.ruff]
line-length = 88
[tool.ruff]
line-length = 88
target-version = "py38"

Comment on lines 184 to 190
session.run(
"black",
"ruff",
"format",
f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since line-length = 88 is already configured in pyproject.toml, and target-version can also be configured there (e.g., target-version = "py38"), passing these options as command-line arguments in noxfile.py is redundant. Relying on pyproject.toml simplifies the noxfile.py configuration and avoids package-specific variable name discrepancies (such as UNIT_TEST_PYTHON_VERSIONS vs ALL_PYTHON).

    session.run(
        "ruff",
        "format",
        *LINT_PATHS,
    )

Comment on lines 178 to 184
session.run(
"black",
"ruff",
"format",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since line-length = 88 is already configured in pyproject.toml, and target-version can also be configured there (e.g., target-version = "py38"), passing these options as command-line arguments in noxfile.py is redundant. Relying on pyproject.toml simplifies the noxfile.py configuration and avoids package-specific variable name discrepancies (such as UNIT_TEST_PYTHON_VERSIONS vs ALL_PYTHON).

    session.run(
        "ruff",
        "format",
        *LINT_PATHS,
    )

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant