Skip to content

Bump mypy in pre-commit #2074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
rev: v1.16.0
hooks:
- id: mypy
args:
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/expressions/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def __init__(self, value: bool) -> None:
super().__init__(value, bool)

@singledispatchmethod
def to(self, type_var: IcebergType) -> Literal[bool]: # type: ignore
def to(self, type_var: IcebergType) -> Literal[bool]:
raise TypeError(f"Cannot convert BooleanLiteral into {type_var}")

@to.register(BooleanType)
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/io/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@


def s3v4_rest_signer(properties: Properties, request: "AWSRequest", **_: Any) -> "AWSRequest":
signer_url = properties.get(S3_SIGNER_URI, properties["uri"]).rstrip("/")
signer_url = properties.get(S3_SIGNER_URI, properties["uri"]).rstrip("/") # type: ignore
signer_endpoint = properties.get(S3_SIGNER_ENDPOINT, S3_SIGNER_ENDPOINT_DEFAULT)

signer_headers = {}
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def _inherit_from_manifest(entry: ManifestEntry, manifest: ManifestFile) -> Mani
"""
# Inherit sequence numbers.
# The snapshot_id is required in V1, inherit with V2 when null
if entry.snapshot_id is None:
if entry.snapshot_id is None and manifest.added_snapshot_id is not None:
entry.snapshot_id = manifest.added_snapshot_id

# in v1 tables, the sequence number is not persisted and can be safely defaulted to 0
Expand Down
8 changes: 4 additions & 4 deletions pyiceberg/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,11 +1049,11 @@ def _truncate_number(
raise ValueError(f"Expected a numeric literal, got: {type(boundary)}")

if isinstance(pred, BoundLessThan):
return LessThanOrEqual(Reference(name), _transform_literal(transform, boundary.decrement())) # type: ignore
return LessThanOrEqual(Reference(name), _transform_literal(transform, boundary.decrement()))
elif isinstance(pred, BoundLessThanOrEqual):
return LessThanOrEqual(Reference(name), _transform_literal(transform, boundary))
elif isinstance(pred, BoundGreaterThan):
return GreaterThanOrEqual(Reference(name), _transform_literal(transform, boundary.increment())) # type: ignore
return GreaterThanOrEqual(Reference(name), _transform_literal(transform, boundary.increment()))
elif isinstance(pred, BoundGreaterThanOrEqual):
return GreaterThanOrEqual(Reference(name), _transform_literal(transform, boundary))
elif isinstance(pred, BoundEqualTo):
Expand All @@ -1073,11 +1073,11 @@ def _truncate_number_strict(
if isinstance(pred, BoundLessThan):
return LessThan(Reference(name), _transform_literal(transform, boundary))
elif isinstance(pred, BoundLessThanOrEqual):
return LessThan(Reference(name), _transform_literal(transform, boundary.increment())) # type: ignore
return LessThan(Reference(name), _transform_literal(transform, boundary.increment()))
elif isinstance(pred, BoundGreaterThan):
return GreaterThan(Reference(name), _transform_literal(transform, boundary))
elif isinstance(pred, BoundGreaterThanOrEqual):
return GreaterThan(Reference(name), _transform_literal(transform, boundary.decrement())) # type: ignore
return GreaterThan(Reference(name), _transform_literal(transform, boundary.decrement()))
elif isinstance(pred, BoundNotEqualTo):
return NotEqualTo(Reference(name), _transform_literal(transform, boundary))
elif isinstance(pred, BoundEqualTo):
Expand Down