Skip to content

Commit de24979

Browse files
committed
Enabled ruff rule UP006
1 parent 7cb5937 commit de24979

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ignore = [
9090
# "C400",
9191
"TRY003",
9292
# "B904",
93-
"UP006",
93+
# "UP006",
9494
"RUF012",
9595
"FBT003",
9696
"C416",

python/datafusion/dataframe.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@
2626
TYPE_CHECKING,
2727
Any,
2828
Iterable,
29-
List,
3029
Literal,
3130
Optional,
32-
Type,
3331
Union,
3432
overload,
3533
)
@@ -75,7 +73,7 @@ class Compression(Enum):
7573
LZ4_RAW = "lz4_raw"
7674

7775
@classmethod
78-
def from_str(cls: Type[Compression], value: str) -> Compression:
76+
def from_str(cls: type[Compression], value: str) -> Compression:
7977
"""Convert a string to a Compression enum value.
8078
8179
Args:
@@ -132,7 +130,7 @@ def into_view(self) -> pa.Table:
132130
"""Convert DataFrame as a ViewTable which can be used in register_table."""
133131
return self.df.into_view()
134132

135-
def __getitem__(self, key: str | List[str]) -> DataFrame:
133+
def __getitem__(self, key: str | list[str]) -> DataFrame:
136134
"""Return a new :py:class`DataFrame` with the specified column or columns.
137135
138136
Args:

python/datafusion/expr.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from __future__ import annotations
2424

25-
from typing import TYPE_CHECKING, Any, Optional, Type
25+
from typing import TYPE_CHECKING, Any, Optional
2626

2727
import pyarrow as pa
2828

@@ -446,9 +446,7 @@ def fill_null(self, value: Any | Expr | None = None) -> Expr:
446446
bool: pa.bool_(),
447447
}
448448

449-
def cast(
450-
self, to: pa.DataType[Any] | Type[float] | Type[int] | Type[str] | Type[bool]
451-
) -> Expr:
449+
def cast(self, to: pa.DataType[Any] | type[float | int | str | bool]) -> Expr:
452450
"""Cast to a new data type."""
453451
if not isinstance(to, pa.DataType):
454452
try:

0 commit comments

Comments
 (0)