diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b69897..3816d44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 # Use the ref you want to point at + rev: v6.0.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast @@ -17,7 +17,7 @@ repos: - id: check-toml - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.11.4' + rev: 'v0.15.5' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -26,7 +26,7 @@ repos: types_or: [python, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.19.1 hooks: - id: mypy entry: python3 -m mypy --config-file pyproject.toml diff --git a/cycquery/ops.py b/cycquery/ops.py index 3c4521e..bbe2a35 100644 --- a/cycquery/ops.py +++ b/cycquery/ops.py @@ -2891,7 +2891,7 @@ class RandomizeOrder(QueryOp): -------- >>> RandomizeOrder()(table) - Warnings: + Warnings -------- Becomes quite slow on large tables. diff --git a/cycquery/util.py b/cycquery/util.py index 1ad1096..b74c856 100644 --- a/cycquery/util.py +++ b/cycquery/util.py @@ -26,7 +26,7 @@ def get_attr_name(name: str) -> str: """Get attribute name (second part of first.second).""" - return name.split(".")[-1] + return name.rsplit(".", maxsplit=1)[-1] @dataclass diff --git a/tests/conftest.py b/tests/conftest.py index 5a5dac2..d54e5eb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -24,7 +24,7 @@ def _setup_sqlite_schema_attachments(db_path: str, schema_files: dict[str, str]) Dictionary mapping schema names to their database file paths. """ - from cycquery.orm import Database + from cycquery.orm import Database # noqa: PLC0415 - Lazy import for monkeypatching # Store the attachment information globally _SCHEMA_ATTACHMENTS[db_path] = schema_files