Skip to content

Commit 5da1278

Browse files
Fokkosungwy
authored andcommitted
Bump pre-commit versions (apache#1344)
1 parent bd80f39 commit 5da1278

15 files changed

Lines changed: 289 additions & 289 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exclude: ^vendor/
1919

2020
repos:
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
22-
rev: v4.5.0
22+
rev: v5.0.0
2323
hooks:
2424
- id: trailing-whitespace
2525
- id: end-of-file-fixer
@@ -29,7 +29,7 @@ repos:
2929
- id: check-ast
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
3131
# Ruff version (Used for linting)
32-
rev: v0.1.8
32+
rev: v0.7.4
3333
hooks:
3434
- id: ruff
3535
args: [ --fix, --exit-non-zero-on-fix, --preview ]
@@ -47,7 +47,7 @@ repos:
4747
- id: pycln
4848
args: [--config=pyproject.toml]
4949
- repo: https://github.com/igorshubovych/markdownlint-cli
50-
rev: v0.41.0
50+
rev: v0.42.0
5151
hooks:
5252
- id: markdownlint
5353
args: ["--fix"]

pyiceberg/catalog/dynamodb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def rename_table(self, from_identifier: Union[str, Identifier], to_identifier: U
330330
log_message += f"Rolled back table creation for {to_database_name}.{to_table_name}."
331331
except (NoSuchTableError, GenericDynamoDbError):
332332
log_message += (
333-
f"Failed to roll back table creation for {to_database_name}.{to_table_name}. " f"Please clean up manually"
333+
f"Failed to roll back table creation for {to_database_name}.{to_table_name}. Please clean up manually"
334334
)
335335

336336
raise ValueError(log_message) from e
@@ -635,7 +635,7 @@ def _convert_dynamo_table_item_to_iceberg_table(self, dynamo_table_item: Dict[st
635635

636636
if table_type.lower() != ICEBERG:
637637
raise NoSuchIcebergTableError(
638-
f"Property table_type is {table_type}, expected {ICEBERG}: " f"{database_name}.{table_name}"
638+
f"Property table_type is {table_type}, expected {ICEBERG}: {database_name}.{table_name}"
639639
)
640640

641641
io = load_file_io(properties=self.properties, location=metadata_location)

pyiceberg/catalog/glue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def rename_table(self, from_identifier: Union[str, Identifier], to_identifier: U
611611
log_message += f"Rolled back table creation for {to_database_name}.{to_table_name}."
612612
except NoSuchTableError:
613613
log_message += (
614-
f"Failed to roll back table creation for {to_database_name}.{to_table_name}. " f"Please clean up manually"
614+
f"Failed to roll back table creation for {to_database_name}.{to_table_name}. Please clean up manually"
615615
)
616616

617617
raise ValueError(log_message) from e

pyiceberg/io/pyarrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,7 @@ def write_parquet(task: WriteTask) -> DataFile:
24422442
for batch in task.record_batches
24432443
]
24442444
arrow_table = pa.Table.from_batches(batches)
2445-
file_path = f'{table_metadata.location}/data/{task.generate_data_file_path("parquet")}'
2445+
file_path = f"{table_metadata.location}/data/{task.generate_data_file_path('parquet')}"
24462446
fo = io.new_output(file_path)
24472447
with fo.create(overwrite=True) as fos:
24482448
with pq.ParquetWriter(fos, schema=arrow_table.schema, **parquet_writer_kwargs) as writer:

pyiceberg/table/update/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def add_column(
179179

180180
if required and not self._allow_incompatible_changes:
181181
# Table format version 1 and 2 cannot add required column because there is no initial value
182-
raise ValueError(f'Incompatible change: cannot add required column: {".".join(path)}')
182+
raise ValueError(f"Incompatible change: cannot add required column: {'.'.join(path)}")
183183

184184
name = path[-1]
185185
parent = path[:-1]

pyiceberg/typedef.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class IcebergRootModel(RootModel[T], Generic[T]):
157157

158158
@lru_cache
159159
def _get_struct_fields(struct_type: StructType) -> Tuple[str, ...]:
160-
return tuple([field.name for field in struct_type.fields])
160+
return tuple(field.name for field in struct_type.fields)
161161

162162

163163
class Record(StructProtocol):

pyiceberg/utils/schema_conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def _convert_logical_map_type(self, avro_type: Dict[str, Any]) -> MapType:
447447
"""
448448
fields = avro_type["items"]["fields"]
449449
if len(fields) != 2:
450-
raise ValueError(f'Invalid key-value pair schema: {avro_type["items"]}')
450+
raise ValueError(f"Invalid key-value pair schema: {avro_type['items']}")
451451
key = self._convert_field(list(filter(lambda f: f["name"] == "key", fields))[0])
452452
value = self._convert_field(list(filter(lambda f: f["name"] == "value", fields))[0])
453453
return MapType(

tests/avro/test_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
import inspect
18+
from _decimal import Decimal
1819
from copy import copy
1920
from datetime import date, datetime, time
2021
from enum import Enum
@@ -23,7 +24,6 @@
2324
from uuid import UUID
2425

2526
import pytest
26-
from _decimal import Decimal
2727
from fastavro import reader, writer
2828

2929
import pyiceberg.avro.file as avro

tests/avro/test_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
import io
2020
import struct
21+
from _decimal import Decimal
2122
from typing import Dict, List
2223

2324
import pytest
24-
from _decimal import Decimal
2525

2626
from pyiceberg.avro.encoder import BinaryEncoder
2727
from pyiceberg.avro.resolver import construct_writer

tests/catalog/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def create_table(
102102
self.__namespaces[namespace] = {}
103103

104104
if not location:
105-
location = f'{self._warehouse_location}/{"/".join(identifier)}'
105+
location = f"{self._warehouse_location}/{'/'.join(identifier)}"
106106
location = location.rstrip("/")
107107

108108
metadata_location = self._get_metadata_location(location=location)

0 commit comments

Comments
 (0)