diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66f830e2b8..3ba55ed2e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: diff --git a/pyiceberg/expressions/literals.py b/pyiceberg/expressions/literals.py index 81e613d55a..921e24e29f 100644 --- a/pyiceberg/expressions/literals.py +++ b/pyiceberg/expressions/literals.py @@ -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) diff --git a/pyiceberg/io/fsspec.py b/pyiceberg/io/fsspec.py index 1cba30a038..cc80725d14 100644 --- a/pyiceberg/io/fsspec.py +++ b/pyiceberg/io/fsspec.py @@ -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 = {} diff --git a/pyiceberg/manifest.py b/pyiceberg/manifest.py index 61cb87e3d8..16080526ae 100644 --- a/pyiceberg/manifest.py +++ b/pyiceberg/manifest.py @@ -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 diff --git a/pyiceberg/transforms.py b/pyiceberg/transforms.py index 8dda85a48b..4c461e9ed7 100644 --- a/pyiceberg/transforms.py +++ b/pyiceberg/transforms.py @@ -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): @@ -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):