Skip to content

Commit efe562a

Browse files
committed
More lints
1 parent ed948ec commit efe562a

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,9 @@ ignore = [
8989
"PLR0913", # Allow many arguments in function definition
9090
"PD901", # Allow variable name df
9191
"N812", # Allow importing functions as `F`
92+
"A005", # Allow module named io
9293
# TODO: Enable all of the following, but this PR is getting too large already
9394
"PTH",
94-
"DTZ007",
95-
"RUF015",
96-
"A005",
97-
"TC001",
98-
"UP035",
9995
]
10096

10197
[tool.ruff.lint.pydocstyle]
@@ -124,7 +120,7 @@ extend-allowed-calls = ["lit", "datafusion.lit"]
124120
"PLR0913",
125121
"PT004",
126122
]
127-
"examples/*" = ["D", "W505", "E501", "T201", "S101", "PLR2004", "ANN001", "ANN202", "INP001"]
123+
"examples/*" = ["D", "W505", "E501", "T201", "S101", "PLR2004", "ANN001", "ANN202", "INP001", "DTZ007", "RUF015"]
128124
"dev/*" = ["D", "E", "T", "S", "PLR", "C", "SIM", "UP", "EXE", "N817", "ERA001", "ANN001"]
129125
"benchmarks/*" = ["D", "F", "T", "BLE", "FURB", "PLR", "E", "TD", "TRY", "S", "SIM", "EXE", "UP", "ERA001", "ANN001", "INP001"]
130126
"docs/*" = ["D"]

python/datafusion/dataframe.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222
from __future__ import annotations
2323

2424
import warnings
25-
from collections.abc import Sequence
25+
from collections.abc import Iterable, Sequence
2626
from typing import (
2727
TYPE_CHECKING,
2828
Any,
29-
Iterable,
3029
Literal,
3130
overload,
3231
)
@@ -55,7 +54,7 @@
5554

5655
if TYPE_CHECKING:
5756
import pathlib
58-
from typing import Callable
57+
from collections.abc import Callable
5958

6059
import pandas as pd
6160
import polars as pl

python/datafusion/dataframe_formatter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@
1919
from __future__ import annotations
2020

2121
from typing import (
22+
TYPE_CHECKING,
2223
Any,
23-
Callable,
2424
Protocol,
2525
runtime_checkable,
2626
)
2727

2828
from datafusion._internal import DataFrame as DataFrameInternal
2929

30+
if TYPE_CHECKING:
31+
from collections.abc import Callable
32+
3033

3134
def _validate_positive_int(value: Any, param_name: str) -> None:
3235
"""Validate that a parameter is a positive integer.

python/datafusion/expr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
from __future__ import annotations
2424

25-
from typing import TYPE_CHECKING, Any, ClassVar, Iterable, Sequence
25+
from collections.abc import Iterable, Sequence
26+
from typing import TYPE_CHECKING, Any, ClassVar
2627

2728
try:
2829
from warnings import deprecated # Python 3.13+

python/datafusion/user_defined.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import functools
2323
from abc import ABCMeta, abstractmethod
2424
from enum import Enum
25-
from typing import TYPE_CHECKING, Any, Callable, Protocol, TypeVar, overload
25+
from typing import TYPE_CHECKING, Any, Protocol, TypeVar, overload
2626

2727
import pyarrow as pa
2828

@@ -31,6 +31,7 @@
3131

3232
if TYPE_CHECKING:
3333
_R = TypeVar("_R", bound=pa.DataType)
34+
from collections.abc import Callable
3435

3536

3637
class Volatility(Enum):

python/tests/test_pyclass_frozen.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
import re
2323
from dataclasses import dataclass
2424
from pathlib import Path
25-
from typing import Iterator
25+
from typing import TYPE_CHECKING
26+
27+
if TYPE_CHECKING:
28+
from collections.abc import Iterator
2629

2730
PYCLASS_RE = re.compile(
2831
r"#\[\s*pyclass\s*(?:\((?P<args>.*?)\))?\s*\]",

0 commit comments

Comments
 (0)