Skip to content

Commit d8d5269

Browse files
committed
lint
1 parent 9d5bc48 commit d8d5269

40 files changed

+854
-478
lines changed

python/pyarrow-stubs/__init__.pyi

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
# ruff: noqa: F401, I001, E402
19-
__version__: str
20-
2118
import pyarrow.lib as _lib
2219

23-
_gc_enabled: bool
24-
2520
from pyarrow.lib import (
2621
BuildInfo,
2722
RuntimeInfo,
@@ -39,13 +34,6 @@ from pyarrow.lib import (
3934
set_io_thread_count,
4035
)
4136

42-
43-
def show_versions() -> None: ...
44-
def show_info() -> None: ...
45-
def _module_is_available(module: str) -> bool: ...
46-
def _filesystem_is_available(fs: str) -> bool: ...
47-
48-
4937
from pyarrow.lib import (
5038
null,
5139
bool_,
@@ -251,7 +239,12 @@ from pyarrow.lib import (
251239
)
252240

253241
# Buffers, allocation
254-
from pyarrow.lib import DeviceAllocationType, Device, MemoryManager, default_cpu_memory_manager
242+
from pyarrow.lib import (
243+
DeviceAllocationType,
244+
Device,
245+
MemoryManager,
246+
default_cpu_memory_manager
247+
)
255248

256249
from pyarrow.lib import (
257250
Buffer,
@@ -351,6 +344,17 @@ from pyarrow.ipc import (
351344
RecordBatchStreamWriter,
352345
)
353346

347+
348+
__version__: str
349+
_gc_enabled: bool
350+
351+
352+
def show_versions() -> None: ...
353+
def show_info() -> None: ...
354+
def _module_is_available(module: str) -> bool: ...
355+
def _filesystem_is_available(fs: str) -> bool: ...
356+
357+
354358
# ----------------------------------------------------------------------
355359
# Returning absolute path to the pyarrow include directory (if bundled, e.g. in
356360
# wheels)

python/pyarrow-stubs/_compute.pyi

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from typing import (
19-
Any,
18+
from collections.abc import (
2019
Callable,
2120
Iterable,
22-
Literal,
2321
Sequence,
22+
)
23+
24+
from typing import (
25+
Any,
26+
Literal,
2427
TypeAlias,
2528
TypedDict,
2629
overload,
@@ -189,8 +192,9 @@ class ExtractRegexSpanOptions(FunctionOptions):
189192

190193

191194
class FilterOptions(FunctionOptions):
192-
def __init__(
193-
self, null_selection_behavior: Literal["drop", "emit_null"] = "drop") -> None: ...
195+
def __init__(self,
196+
null_selection_behavior: Literal["drop",
197+
"emit_null"] = "drop") -> None: ...
194198

195199

196200
class IndexOptions(FunctionOptions):
@@ -398,12 +402,16 @@ class SetLookupOptions(FunctionOptions):
398402

399403

400404
class SliceOptions(FunctionOptions):
401-
def __init__(self, start: int, stop: int | None = None, step: int = 1) -> None: ...
405+
def __init__(
406+
self, start: int, stop: int | None = None, step: int = 1) -> None: ...
402407

403408

404409
class SortOptions(FunctionOptions):
405410
def __init__(
406-
self, sort_keys: Sequence[tuple[str, _Order]], *, null_placement: _Placement = "at_end"
411+
self,
412+
sort_keys: Sequence[tuple[str, _Order]],
413+
*,
414+
null_placement: _Placement = "at_end"
407415
) -> None: ...
408416

409417

@@ -424,15 +432,18 @@ class StrftimeOptions(FunctionOptions):
424432

425433

426434
class StrptimeOptions(FunctionOptions):
427-
def __init__(
428-
self, format: str, unit: Literal["s", "ms", "us", "ns"], error_is_null: bool = False
429-
) -> None: ...
435+
def __init__(self,
436+
format: str,
437+
unit: Literal["s",
438+
"ms",
439+
"us",
440+
"ns"],
441+
error_is_null: bool = False) -> None: ...
430442

431443

432444
class StructFieldOptions(FunctionOptions):
433-
def __init__(
434-
self, indices: list[str] | list[bytes] | list[int] | Expression | bytes | str | int
435-
) -> None: ...
445+
def __init__(self, indices: list[str] | list[bytes] |
446+
list[int] | Expression | bytes | str | int) -> None: ...
436447

437448

438449
class TakeOptions(FunctionOptions):
@@ -497,8 +508,9 @@ def list_functions() -> list[str]: ...
497508

498509

499510
def call_tabular_function(
500-
function_name: str, args: Iterable | None = None, func_registry: FunctionRegistry | None = None
501-
) -> lib.RecordBatchReader: ...
511+
function_name: str,
512+
args: Iterable | None = None,
513+
func_registry: FunctionRegistry | None = None) -> lib.RecordBatchReader: ...
502514

503515

504516
class _FunctionDoc(TypedDict):
@@ -569,10 +581,10 @@ class Expression(lib._Weakrefable):
569581
def __sub__(self, other) -> Expression: ...
570582
def __eq__(self, value: object) -> Expression: ... # type: ignore[override]
571583
def __ne__(self, value: object) -> Expression: ... # type: ignore[override]
572-
def __gt__(self, value: object) -> Expression: ... # type: ignore[override]
573-
def __lt__(self, value: object) -> Expression: ... # type: ignore[override]
574-
def __ge__(self, value: object) -> Expression: ... # type: ignore[override]
575-
def __le__(self, value: object) -> Expression: ... # type: ignore[override]
584+
def __gt__(self, value: object) -> Expression: ...
585+
def __lt__(self, value: object) -> Expression: ...
586+
def __ge__(self, value: object) -> Expression: ...
587+
def __le__(self, value: object) -> Expression: ...
576588
def __truediv__(self, other) -> Expression: ...
577589
def is_valid(self) -> bool: ...
578590
def is_null(self, nan_is_null: bool = False) -> Expression: ...

python/pyarrow-stubs/_csv.pyi

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
from collections.abc import Callable
1819
from dataclasses import dataclass, field
19-
from typing import IO, Any, Callable, Literal
20+
from typing import IO, Any, Literal
2021

2122
from _typeshed import StrPath
2223

@@ -25,7 +26,7 @@ from . import lib
2526

2627
@dataclass(kw_only=True)
2728
class ReadOptions(lib._Weakrefable):
28-
use_threads: bool = field(default=True, kw_only=False)
29+
use_threads: bool = field(default=True, kw_only=False) # noqa: Y015
2930
block_size: int | None = None
3031
skip_rows: int = 0
3132
skip_rows_after_names: int = 0
@@ -38,7 +39,7 @@ class ReadOptions(lib._Weakrefable):
3839
@dataclass(kw_only=True)
3940
class ParseOptions(lib._Weakrefable):
4041

41-
delimiter: str = field(default=",", kw_only=False)
42+
delimiter: str = field(default=",", kw_only=False) # noqa: Y015
4243
quote_char: str | Literal[False] = '"'
4344
double_quote: bool = True
4445
escape_char: str | Literal[False] = False
@@ -52,7 +53,7 @@ class ParseOptions(lib._Weakrefable):
5253
@dataclass(kw_only=True)
5354
class ConvertOptions(lib._Weakrefable):
5455

55-
check_utf8: bool = field(default=True, kw_only=False)
56+
check_utf8: bool = field(default=True, kw_only=False) # noqa: Y015
5657
column_types: lib.Schema | dict | None = None
5758
null_values: list[str] | None = None
5859
true_values: list[str] | None = None
@@ -72,7 +73,7 @@ class ConvertOptions(lib._Weakrefable):
7273
@dataclass(kw_only=True)
7374
class WriteOptions(lib._Weakrefable):
7475

75-
include_header: bool = field(default=True, kw_only=False)
76+
include_header: bool = field(default=True, kw_only=False) # noqa: Y015
7677
batch_size: int = 1024
7778
delimiter: str = ","
7879
quoting_style: Literal["needed", "all_valid", "none"] = "needed"

python/pyarrow-stubs/_dataset.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@ if sys.version_info >= (3, 11):
2121
from typing import Self
2222
else:
2323
from typing_extensions import Self
24+
from collections.abc import Callable, Iterator
2425
from typing import (
2526
IO,
2627
Any,
27-
Callable,
2828
Generic,
29-
Iterator,
3029
Literal,
3130
NamedTuple,
3231
TypeVar,
33-
overload,
3432
)
3533

3634
from _typeshed import StrPath

python/pyarrow-stubs/_dataset_parquet.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
from collections.abc import Iterable
1819
from dataclasses import dataclass
19-
from typing import IO, Any, Iterable, TypedDict
20+
from typing import IO, Any, TypedDict
2021

2122
from _typeshed import StrPath
2223

@@ -112,8 +113,10 @@ class ParquetFileFragment(FileFragment):
112113
class ParquetReadOptions(_Weakrefable):
113114

114115
def __init__(
115-
self, dictionary_columns: list[str] | None, coerce_int96_timestamp_unit: str | None = None
116-
) -> None: ...
116+
self,
117+
dictionary_columns: list[str] | None,
118+
coerce_int96_timestamp_unit: str | None = None) -> None: ...
119+
117120
@property
118121
def coerce_int96_timestamp_unit(self) -> str: ...
119122
@coerce_int96_timestamp_unit.setter

python/pyarrow-stubs/_dataset_parquet_encryption.pyi

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

1818
from ._dataset_parquet import ParquetFileWriteOptions, ParquetFragmentScanOptions
1919
from ._parquet import FileDecryptionProperties
20-
from ._parquet_encryption import CryptoFactory, EncryptionConfiguration, KmsConnectionConfig
20+
from ._parquet_encryption import (
21+
CryptoFactory, EncryptionConfiguration, KmsConnectionConfig)
2122
from .lib import _Weakrefable
2223

2324

0 commit comments

Comments
 (0)