Skip to content

Commit b829737

Browse files
authored
Bump pre-commit and such (#442)
1 parent 5ea0617 commit b829737

File tree

8 files changed

+36
-21
lines changed

8 files changed

+36
-21
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ repos:
3636
- id: ruff-format
3737
args: [ --preview ]
3838
- repo: https://github.com/pre-commit/mirrors-mypy
39-
rev: v1.6.1
39+
rev: v1.8.0
4040
hooks:
4141
- id: mypy
4242
args:
4343
[--install-types, --non-interactive, --config=pyproject.toml]
4444
- repo: https://github.com/hadialqattan/pycln
45-
rev: v2.3.0
45+
rev: v2.4.0
4646
hooks:
4747
- id: pycln
4848
args: [--config=pyproject.toml]

pyiceberg/avro/decoder_fast.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,54 @@ from pyiceberg.avro.decoder import BinaryDecoder
2020
class CythonBinaryDecoder(BinaryDecoder):
2121
def __init__(self, input_contents: bytes) -> None:
2222
pass
23+
2324
def tell(self) -> int:
2425
pass
26+
2527
def read(self, n: int) -> bytes:
2628
pass
29+
2730
def read_boolean(self) -> bool:
2831
pass
32+
2933
def read_int(self) -> int:
3034
pass
35+
3136
def read_ints(self, count: int) -> tuple[int, ...]:
3237
pass
38+
3339
def read_int_bytes_dict(self, count: int, dest: dict[int, bytes]) -> None:
3440
pass
41+
3542
def read_bytes(self) -> bytes:
3643
pass
44+
3745
def read_float(self) -> float:
3846
pass
47+
3948
def read_double(self) -> float:
4049
pass
50+
4151
def read_utf8(self) -> str:
4252
pass
53+
4354
def skip(self, n: int) -> None:
4455
pass
56+
4557
def skip_int(self) -> None:
4658
pass
59+
4760
def skip_boolean(self) -> None:
4861
pass
62+
4963
def skip_float(self) -> None:
5064
pass
65+
5166
def skip_double(self) -> None:
5267
pass
68+
5369
def skip_bytes(self) -> None:
5470
pass
71+
5572
def skip_utf8(self) -> None:
5673
pass

pyiceberg/avro/decoder_fast.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ unsigned_long_long_array_template = cython.declare(array.array, array.array('Q',
3232

3333
@cython.final
3434
cdef class CythonBinaryDecoder:
35-
"""Implement a BinaryDecoder that reads from an in-memory buffer.
36-
37-
"""
35+
"""Implement a BinaryDecoder that reads from an in-memory buffer."""
3836

3937
# This the data that is duplicated when the decoder is created.
4038
cdef unsigned char *_data

pyiceberg/catalog/rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Endpoints:
116116
SIGV4_SERVICE = "rest.signing-name"
117117
AUTH_URL = "rest.authorization-url"
118118

119-
NAMESPACE_SEPARATOR = b"\x1F".decode(UTF8)
119+
NAMESPACE_SEPARATOR = b"\x1f".decode(UTF8)
120120

121121

122122
def _retry_hook(retry_state: RetryCallState) -> None:

pyiceberg/conversions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def _(primitive_type: DecimalType, value: Decimal) -> bytes:
267267
return decimal_to_bytes(value)
268268

269269

270-
@singledispatch
270+
@singledispatch # type: ignore
271271
def from_bytes(primitive_type: PrimitiveType, b: bytes) -> L: # type: ignore
272272
"""Convert bytes to a built-in python value.
273273

pyiceberg/table/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ def rename_column(self, path_from: Union[str, Tuple[str, ...]], new_name: str) -
16951695
from_field_correct_casing = self._schema.find_column_name(field_from.field_id)
16961696
if from_field_correct_casing in self._identifier_field_names:
16971697
self._identifier_field_names.remove(from_field_correct_casing)
1698-
new_identifier_path = f"{from_field_correct_casing[:-len(field_from.name)]}{new_name}"
1698+
new_identifier_path = f"{from_field_correct_casing[: -len(field_from.name)]}{new_name}"
16991699
self._identifier_field_names.add(new_identifier_path)
17001700

17011701
return self

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ source = ['pyiceberg/']
312312
[tool.ruff]
313313
src = ['pyiceberg','tests']
314314
extend-exclude = ["dev/provision.py"]
315-
select = [
315+
lint.select = [
316316
"E", # pycodestyle
317317
"W", # pycodestyle
318318
"F", # Pyflakes
@@ -322,11 +322,11 @@ select = [
322322
"I", # isort
323323
"UP", # pyupgrade
324324
]
325-
ignore = ["E501","E203","B024","B028","UP037"]
325+
lint.ignore = ["E501","E203","B024","B028","UP037"]
326326

327327
# Allow autofix for all enabled rules (when `--fix`) is provided.
328-
fixable = ["ALL"]
329-
unfixable = []
328+
lint.fixable = ["ALL"]
329+
lint.unfixable = []
330330

331331
# Exclude a variety of commonly ignored directories.
332332
exclude = [
@@ -352,19 +352,19 @@ exclude = [
352352
"node_modules",
353353
"venv",
354354
]
355-
per-file-ignores = {}
355+
lint.per-file-ignores = {}
356356
# Ignore _all_ violations.
357357
# Same as Black.
358358
line-length = 130
359359

360360
# Allow unused variables when underscore-prefixed.
361-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
361+
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
362362

363-
[tool.ruff.pyupgrade]
363+
[tool.ruff.lint.pyupgrade]
364364
# Preserve types, even if a file imports `from __future__ import annotations`.
365365
keep-runtime-typing = true
366366

367-
[tool.ruff.isort]
367+
[tool.ruff.lint.isort]
368368
detect-same-package = true
369369
lines-between-types = 0
370370
known-first-party = ["pyiceberg", "tests"]

tests/avro/test_decoder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ def test_read_single_byte_at_the_time(decoder_class: Callable[[bytes], BinaryDec
144144

145145
@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
146146
def test_read_float(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
147-
decoder = decoder_class(b"\x00\x00\x9A\x41")
147+
decoder = decoder_class(b"\x00\x00\x9a\x41")
148148
assert decoder.read_float() == 19.25
149149

150150

151151
@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
152152
def test_skip_float(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
153-
decoder = decoder_class(b"\x00\x00\x9A\x41")
153+
decoder = decoder_class(b"\x00\x00\x9a\x41")
154154
assert decoder.tell() == 0
155155
decoder.skip_float()
156156
assert decoder.tell() == 4
@@ -179,21 +179,21 @@ def test_read_bytes(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
179179

180180
@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
181181
def test_read_utf8(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
182-
decoder = decoder_class(b"\x04\x76\x6F")
182+
decoder = decoder_class(b"\x04\x76\x6f")
183183
assert decoder.read_utf8() == "vo"
184184

185185

186186
@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
187187
def test_skip_utf8(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
188-
decoder = decoder_class(b"\x04\x76\x6F")
188+
decoder = decoder_class(b"\x04\x76\x6f")
189189
assert decoder.tell() == 0
190190
decoder.skip_utf8()
191191
assert decoder.tell() == 3
192192

193193

194194
@pytest.mark.parametrize("decoder_class", AVAILABLE_DECODERS)
195195
def test_read_int_as_float(decoder_class: Callable[[bytes], BinaryDecoder]) -> None:
196-
decoder = decoder_class(b"\x00\x00\x9A\x41")
196+
decoder = decoder_class(b"\x00\x00\x9a\x41")
197197
reader = resolve_reader(FloatType(), DoubleType())
198198
assert reader.read(decoder) == 19.25
199199

0 commit comments

Comments
 (0)