Skip to content

Commit 322ed94

Browse files
committed
fix some annotations
1 parent 468999d commit 322ed94

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

python/pyarrow-stubs/pyarrow/_dataset_parquet.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ParquetFileFormat(FileFormat):
4646
self,
4747
read_options: ParquetReadOptions | None = None,
4848
default_fragment_scan_options: ParquetFragmentScanOptions | None = None,
49-
**kwargs,
49+
**kwargs: Any,
5050
) -> None: ...
5151
@property
5252
def read_options(self) -> ParquetReadOptions: ...
@@ -60,7 +60,6 @@ class ParquetFileFormat(FileFormat):
6060
def make_fragment(
6161
self,
6262
file: StrPath | IO | Buffer | BufferReader,
63-
6463
filesystem: SupportedFileSystem | None = None,
6564
partition_expression: Expression | None = None,
6665
row_groups: Iterable[int] | None = None,

python/pyarrow/tests/test_fs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,13 +1440,13 @@ def test_s3_proxy_options(monkeypatch, pickle_module):
14401440
S3FileSystem(proxy_options=('http', 'localhost', 9090))
14411441
# Missing scheme
14421442
with pytest.raises(KeyError):
1443-
S3FileSystem(proxy_options={'host': 'localhost', 'port': 9090})
1443+
S3FileSystem(proxy_options={'host': 'localhost', 'port': 9090}) # type: ignore[missing-typed-dict-key]
14441444
# Missing host
14451445
with pytest.raises(KeyError):
1446-
S3FileSystem(proxy_options={'scheme': 'https', 'port': 9090})
1446+
S3FileSystem(proxy_options={'scheme': 'https', 'port': 9090}) # type: ignore[missing-typed-dict-key]
14471447
# Missing port
14481448
with pytest.raises(KeyError):
1449-
S3FileSystem(proxy_options={'scheme': 'http', 'host': 'localhost'})
1449+
S3FileSystem(proxy_options={'scheme': 'http', 'host': 'localhost'}) # type: ignore[missing-typed-dict-key]
14501450
# Invalid proxy URI (invalid scheme httpsB)
14511451
with pytest.raises(pa.ArrowInvalid):
14521452
S3FileSystem(proxy_options='httpsB://localhost:9000')

python/pyarrow/tests/test_scalars.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,9 @@ def test_timestamp():
424424
expected = pd.Timestamp('2000-01-01 12:34:56')
425425

426426
assert arrow_arr[0].as_py() == expected
427-
assert cast(pa.TimestampScalar, arrow_arr[0]).value * 1000**i == expected.value
427+
value = cast(pa.TimestampScalar, arrow_arr[0]).value
428+
assert value is not None
429+
assert value * 1000**i == expected.value
428430

429431
tz = 'America/New_York'
430432
arrow_type = pa.timestamp(unit, tz=tz)
@@ -436,7 +438,9 @@ def test_timestamp():
436438
.tz_convert(tz))
437439

438440
assert arrow_arr[0].as_py() == expected
439-
assert cast(pa.TimestampScalar, arrow_arr[0]).value * 1000**i == expected.value
441+
value = cast(pa.TimestampScalar, arrow_arr[0]).value
442+
assert value is not None
443+
assert value * 1000**i == expected.value
440444

441445

442446
@pytest.mark.nopandas
@@ -531,7 +535,7 @@ def test_duration_nanos_nopandas():
531535

532536

533537
def test_month_day_nano_interval():
534-
triple = pa.MonthDayNano([-3600, 1800, -50])
538+
triple = pa.MonthDayNano([-3600, 1800, -50]) # type: ignore[invalid-argument-type]
535539
arr = pa.array([triple])
536540
assert isinstance(arr[0].as_py(), pa.MonthDayNano)
537541
assert arr[0].as_py() == triple

python/pyarrow/tests/test_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def test_schema_equals_invalid_type():
548548

549549
for val in [None, 'string', pa.array([1, 2])]:
550550
with pytest.raises(TypeError):
551-
schema.equals(val)
551+
schema.equals(val) # type: ignore[invalid-argument-type]
552552

553553

554554
def test_schema_equality_operators():

0 commit comments

Comments
 (0)